About Question enthuware.ocajp.i.v7.2.1007 :
Posted: Thu Sep 25, 2014 5:53 pm
uhm, this is plain wrong if you ask me...i answered option 1, 2, 6 and 6 is indeed wrong since of course static and abstract cant be together. But, it is asked that "all the members of the same package have access to it"...clearly, this isnt the case with protected since not every class in the same package has an inheritance relationship to this method's class
any explanation? i would say ask for 2 options instead of 3 et voila, problem solved, good question..
EDIT:
Ok i tested it and, believe it or not, this is the moment i finally get that protected really incorporates 'package private' ... i mean, till now every book or teacher whom talked to me about it said package private means that in the package every class has access, and protected on the other hand means that the childs have access...im pretty sure that at no point it is mentioned that protected ALSO means every class in the package...how difficult would it be to make things clear?? while it was said that private, package private, protected, public was the order how things worked..it was never EXPLICITELY mentioned that protected incorporated package private...even the teacher didnt know the order at some point because its never mentioned clear enough....how is this possible, why do i have to do all the work here
anyhow, thanx guys I understand a little bit more of Java's quirks, although i had to do some testing myself
any explanation? i would say ask for 2 options instead of 3 et voila, problem solved, good question..
EDIT:
Ok i tested it and, believe it or not, this is the moment i finally get that protected really incorporates 'package private' ... i mean, till now every book or teacher whom talked to me about it said package private means that in the package every class has access, and protected on the other hand means that the childs have access...im pretty sure that at no point it is mentioned that protected ALSO means every class in the package...how difficult would it be to make things clear?? while it was said that private, package private, protected, public was the order how things worked..it was never EXPLICITELY mentioned that protected incorporated package private...even the teacher didnt know the order at some point because its never mentioned clear enough....how is this possible, why do i have to do all the work here
anyhow, thanx guys I understand a little bit more of Java's quirks, although i had to do some testing myself
