Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

john shen

Greenhorn
+ Follow
since Jul 23, 2000
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by john shen

thanks! i esp. appreciate your comments on various mocks. for ones i have tried, the comments are fair and objective. you are very polite towards mock authors (rightly so, as they have put in a lot of efforts anyway), but i really wish i had seen your list first before wasting time on mediocre ones. i would started with the ones that you have give high marks. good work.
same experiences here. if you are aware of this and if you are not confused to the point of desperation, you can still learn by it.
i found www.javaranch.com/maha listing with comments a very good source for guaging mocks for what i have seen. maha is quite polite to mock authors (who did put up lots of efforts and are giving their services for free), but if you are short of time, you should focus on what maha considers very good, cannot miss, etc.
17 years ago
jim, i wonder if you could comment on this observation of mine. in cases like this in real exam, would it be safer to assume that the objective of the question is to test you the concept of inheritance and thus expect you to pick the one shown here, even if it is actually wrong? i hope nobody runs into this type of dilemma, but someone could, right? thanks.
17 years ago
yes, that is now perfectly clear. thanks for clear it up! i guess i was just confused by the wording then. i was thinking about using, not creating, when i read the question.
http://www.jaworski.com/java/certification/
said that local inner classes are not associated with an outer class instance (the applet is random so i cannot give a number).
i think local inner class instances must have associated outer classes instances. maybe it is the ambiguity of the matter. (classes of course have not outer class instance, it is the instances that have or have not associated outer instance), otherwise it does not make sense that they can access outer instance member variables.
anyone else has similar thoughts after taking his samples (which are mostly clear)?
thanks bill. it is reassuring. otherwise it would add to the confusion. so the strategy would be to pick the least wrong one if all the answers seem to be incorrect.
Object ob;
ob = new Object(); // illegal if "ob" is instance variable
it is just the syntax:
Object ob;
{ob = new Object();} // need to use instance initializer
just what the designer decided to allow.
ibm mock states that it could happen (warning in every question where more than 1 correct answer is possible) and indeed it does. marcus green mock says it can happen but the question itself does not state that it is possible that none is correct, e.g., q8 in exam 3).
the sun samples never said that it is possible there is no correct answer and indeed they don't show this type of questions.
for those who have taken the real one, what is your experience? thanks for sharing.
these mocks vary greatly in quality. some are really good and help you, some are harmless, and yet some are actually misleading (too many mistakes/typos, keep trying to trick you so if you get used to their style, you will actually get confused and try to find problems where there aren't any, etc.) if java ranch could have a voting booth for closeness to real (or helped those who passed most) and then rank the links, it would really help newcomers.
write(int b)
Writes the specified byte to this output stream.
this is what the javadoc says. this means that all but the right-most 4 bits are discarded during write. you can try it yourself.
the exam question answer is wrong. you can read the entire chapter of Polymorphism in Bruce Eckel's book. compile-time dispatching is not considered polymorphism in OOP. here is a quote from the summary of that chapter:
Polymorphism means �different forms.� In object-oriented programming,you have the same face (the common interface in the base class) and different forms using that face: the different versions of the dynamically bound methods.
i think the confusion is between package hierarchy and object hierarchy, which has little to do with each other, but the asker thought they are related.
there are questions on mocks that try to confuse you about them (e.g., what is the superclass of awt event classes? surely it is not in the java.awt!) therefore the confused feeling is legit, esp. when the java designers seem to be placing related classes randomly in unrelated packages. at least some of the time.
you need to add a validate() again in your callback function for the button so that the button will show up.