Home arrow static arrow Java Programming [Archive] - very confusing post
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - very confusing post
This topic has 3 replies on 1 page.

Posts:97
Registered: 5/26/04
very confusing post  
Aug 9, 2004 9:36 AM



 
http://forum.java.sun.com/thread.jsp?forum=24&thread=544330
is really confusing me. I am trying to grasp some access concepts here but different ppl seem to be getting different results, could somebody explain?
 

Posts:3,258
Registered: 00-08-28
Re: very confusing post  
Aug 9, 2004 9:37 AM (reply 1 of 3)



 
I dont see much confusing in there. Just try the code and see for yourself
 

Posts:3,258
Registered: 00-08-28
Re: very confusing post  
Aug 9, 2004 11:23 AM (reply 2 of 3)



 
my bad I didnt put them in different packages. HTH
 

Posts:3,999
Registered: 00-05-26
Re: very confusing post  
Aug 9, 2004 2:13 PM (reply 3 of 3)



 
Protected is based on either the same package (which the example is not) or inheritance.

Duck1 does inherit from Bird, however the access is from a static method of Duck1, and is therefore not being used with inheritance. If an instance method of Duck1 had tried to access it, it would have worked.
 
This topic has 3 replies on 1 page.