Help coderanch get a
new server
by contributing to the fundraiser

Moe Aptelia

Greenhorn
+ Follow
since Apr 16, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Moe Aptelia

With the following code:



How can I explain that the class Test is correct so that the attribute x shouldn't be visible (x attribute should become private in Child class because of the inheritance mechanism, shoudn't it ?)

[ April 16, 2008: Message edited by: Nicolas DE GROOTE ]
[ April 16, 2008: Message edited by: Nicolas DE GROOTE ]
Test4 shouldn't fail...
Test4 and Parent are in the same package. So the protected attribute x in Parent is visible in all the package package1...
Hi !
I have the following code:



Normally, the class Test3 shouldn't compile because a protected attribute should become private when it is inherited ! But actualaly, it compiles with Java5.0.

Does anyone could explain me why ?

Thanks in advance !