Yui Huang

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

Recent posts by Yui Huang

Ankit Garg wrote:Thread wait and notify are not on the exam anymore. I have to check the objectives but I think threads are still on the exam...


hmm... I got one question about notify() on last week.
Thank you, John, so much for sharing the info, which had encouraged me a lot!!
I would like to concur that the real exam is easier than the practice exams that I have done. I got frustrated doing K&B's Practice Exams which I score less than 50% the first time, also barely have enough time to finish 60 questions in 180 minutes. What's more, I learned that the exam duration is shortened to 150 mins just 1 day before the scheduled exam date - which adds extra tension. Today I took the exam, finished early and have sufficient time to review the answers. The result - passed with 95% - maybe with some luck.

Thank you all JavaRancers!!!


The equals method is the object method so it can access the private instance variable without problem.
Very good point, Matt. Thank you for pointing that out. I was trying to make the code to compile.

jamil lusa wrote:
the answer given is like this:

Both classes do not override the toString method appropriately.
However they override it according to the rules based on which overriding should be done.
The output of this program would be something like Fir@1368a



I was tricked by the question so I checked the API. To override the toString method, it should be like this:

which should be "public" and takes "no arg". Thanks! I learned one more thing today!
I have seen some mock exam question about this. The following code would throw java.lang.NullPointerException.


And the following throws java.lang.ExceptionInInitializerError when the class is loaded.

Matthew Brown wrote:Because you can create an instance of Erode with any X, Y and Z, the uses of x, y and z in the erode() method need to be valid for any possible X, Y and Z. You know they must be a subclass of Object, but you don't know anything else. The erode() method can't know which X, Y and Z you're going to happen to use in a particular case.



If you limit the the type declaration to Number and String, it would compile.