0

Program Showing An error occured

My program is showing an error occured it wouldn't run class Addresses{ String cityname,location; int zipcode; Addresses(String cityname, String location,int zipcode){ this.cityname= cityname; this.location= location; this.zipcode= zipcode; } class Employee{ String name; String rank; Addresses addresses; } Employee(String name, String rank, Addresses addresses){ this.name= name; this.rank= rank; this.addresses= addresses; } void display{ System.out.println(name+" "+ rank); System.out.println(addresses.cityname+" "+addresses.location+" "+ addresses.zipcode ); } public class Execute{ public static void main(String args[]){ Addresses n1= new Addresses("Minna","Nigeria", 234);Employee n2= new Employee("Bala Hassan", "Programmer",n1); n2.display(); } }

24th Jul 2019, 6:04 PM
Dprincebh
Dprincebh - avatar
4 ответов
+ 1
Thanks
24th Jul 2019, 7:09 PM
Dprincebh
Dprincebh - avatar
24th Jul 2019, 7:11 PM
Dprincebh
Dprincebh - avatar
24th Jul 2019, 7:13 PM
Dprincebh
Dprincebh - avatar