Rustam Boltaev

Greenhorn
+ Follow
since Apr 12, 2009
Merit badge: grant badges
For More
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rustam Boltaev

That's a good point, how could I miss that!!! The link has a good answer by the way.
My attention was drawn to somwhere else, in the answer. A and B are correct:

A. The output could contain 30
B. The output could contain @bf73fa

The first is pretty obvious, what I can't figure out is how to calculate the second. I am guessing that it might be the String representation of Suits.values() array object. But I still don't know how I can come up with this answer without actually running the code on the machine.
Thanks for the warm welcome , it's good to be here.

I think now I understand how and why an "overridden" class method actually becomes "hidden", thanks to you and the study guide. My only problem is that I can't think of any single case where one would want to "hide" a static method (for a good design, effectiveness, reuse or any other reason). It actually seems redundant to me.

Marc Torpe wrote:http://faq.javaranch.com/view?OverridingVsHiding



Thanks for the link, that helped me too. But now I have another question: What's the point of hiding(redefining?) a static method if there is no polymorphism involved, and if one can always access the original static method through a class, its instance, or an instance of its subclass?