Discussion :: Declarations and Access Control - General Questions (Q.No.1)
|Sreejith.K said: (Jan 27, 2011)|
|Thanks. Very nice tutorial.|
|Suji said: (Jun 24, 2011)|
|Thanks. It's very useful me|
|Rahul said: (Aug 22, 2011)|
|Please explain " the subclasses clause in the question eliminates default" ?.|
|Akash said: (Jul 18, 2013)|
|Why not the second answer is public?|
|Sam said: (Nov 8, 2014)|
|Private - Native.
Default - Package access.
Protected - Inherit access.
Public - Universe.
|Piyali said: (Dec 23, 2014)|
|If any class declared as private, other classes even in the same package, can not access the member of private class by composition. So, in the above question if the constraint was the "same package" instead of "any package" answer should not be option 'B'.|
|Msheliga said: (Jan 28, 2017)|
|I believe the following statement is incorrect as option B is private, not default.
B (private) would be the answer if the constraint was the "same package" instead of "any package" in other words the subclasses clause in the question eliminates default.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.