This content has been marked as final. Show 2 replies
System.out.println("Name: " + A.getName() ); // this gives me null, why ????????? ,A.getName() will return null because the static String name in class A has never
I was expecting "Abebe"
been given a value. Notice that the main() method of class A is never invoked.
System.out.println("name:"+ obj2.getName()); // this gives me null 2, helppppppp? Iobj2.getName() is the same as A.getName() and will (therefore) return null as well.
was expecting "Abebe"
In general if you mean A.getName() you should say A.getName() and not
Thank you for your fast response.