+ 1
Wrong answer?
Is it correct answer? Select the access modifier to hide members from their package. - protected - none specified - public - private -> it is correct according to Java Challenge
5 Respuestas
+ 5
Yes it is correct I think because they are talking about package and it can contain many classes inside. So a public member of a class will always be visible to other classes similarly a protected member of a class will be visible to its subclass when inherited and only private is accessible within the class in that package.
+ 3
Well, when speaking of members of a class in Java:
Protected = member can be accessed within its own package and by a subclass
None specified = package-private, again accessible within package
Public = accessible by all code
Only PRIVATE prevents other classes within the same package from accessing members of the given class.
+ 1
Ok, I didnt understand questions, thanks for your answer, now is clear.
+ 1
In this app, in Java challenge.
0
Maciej Kowalik yes these are not so good framed questions. By the way where do you get these challenges?