aspose file tools*
The moose likes Java in General and the fly likes Rule Round-up Game Question #108 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Rule Round-up Game Question #108" Watch "Rule Round-up Game Question #108" New topic
Author

Rule Round-up Game Question #108

Igor Stojanovic
Ranch Hand

Joined: Feb 18, 2005
Posts: 58
Hi,

I got confused when question #108 pop up:


They say that correct answer is 4,
doStuff() from B class gets called...

I dont understand why this should be,
if we declare doStuff() method to be static then correct answer would be 3.,
doStuff() from A class would be called...
they didnt say if method doStuff() was declared with default acces modifier or with static so I think that question should be more specific about acces modifier , plz correct me if I am thinking wrong


kind regard
Igor
[ February 19, 2005: Message edited by: Igor Stojanovic ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The question states that "B overrides the doStuff() method inherited from A." To me, this implies that doStuff() is NOT static because if it was then B couldn't override it.

Layne


Java API Documentation
The Java Tutorial
Igor Stojanovic
Ranch Hand

Joined: Feb 18, 2005
Posts: 58
Thx for quick answer I should learn english better first then java (english is my 3rd language)




kind regards
Igor
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
For the record, the question could be stated much more clearly by giving the code for class A and class B. In fact, if the code includes System.output.println() calls, the question could just ask what the output of the program would be.

And I would have never guessed that English is not your native language. You write very clearly and with correct grammar.

Layne
[ February 19, 2005: Message edited by: Layne Lund ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
There is not much space to ask a question in the Rule Roundup game. Not enough space to give the code for class A and class B.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
It wouldn't take much room:

Well...maybe that wouldn't fit in the available space...hmm...

Layne
 
Don't get me started about those stupid light bulbs.
 
subject: Rule Round-up Game Question #108