Punit Singh wrote:Wei, nice example, but reflection is very powerful tool, it can make many things possible in Java, it can make String objects mutable from immutable.
So better leave Reflection API untouched, otherwise it will break all the oops concepts.
I got this code from here:
Henry Wong wrote:Do you mean, given this....
How do you call the sizzle() method, of the anonymous inner class that subclasses the popcorn class?
The answer is... You can't. The sizzle method is not defined by any of its super classes or interfaces (which are still in scope).
Banu Chowdary wrote:What does it mean???
When using HashSet or LinkedHashSet, the objects you add to them
must override hashCode(). If they don’t override hashCode(), the default Object.
hashCode() method will allow multiple objects that you might consider "meaningfully
equal" to be added to your "no duplicates allowed" set. (K&S)
alex sandoval wrote:Hi everyone! I will be taking SCJP tomorrow in the morning (GMT+8). I am doing the final exam of ExamLab by Devaka Cooray (Thanks Devaka great simulator!).
I just want to make sure if question 19 of Final exam from ExamLab is correct. It says that LinkedHashSet is faster than HashSet because it is doubly-linked. Is it true? Because I researched the API didn't find any statement that it is faster than HashSet or any other Set implementations because of its doubly-linked elements. Hope you may help me clear my thoughts before taking the exam tomorrow.
By the way, wish me luck guys! Thanks