• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help an explanation please

 
Pad Ven
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When I was attempting an exam, I came across 2 questions whose mutually contradicting answers have confused me

Question 19. Select three correct statements.



A. A static method may override another static method.
B. A static method cannot override a non-static method.
C. A non-static method cannot override a static method.
D. A non-static method may be overloaded by a static method.
E. A synchronized method cannot be overridden.


I gave correct answer as B,C,D.

My concern is regarding the choice A synchronized method cannot be overridden.

Because for the following question


Question 31. Select two correct statements.



A. A static method method can declared abstract.
B. A protected method can be overridden to have "default" accessibility (that is, no accessibility modifier).
C. A abstract method can be declared private.
D. A synchronized method can be overridden by a non-synchronized one.
E. A native method can be declared static.



One of the correct answers is D and the explanation given is:

Synchronization is matter of implementation and it is perfectly legal to override a synchronized method to be unsynchronized or the other way around

Can somebody clarify this point?

In what meaning do the two choices in above questions differ, as regards overriding synchronized method?

Regards,
Padmanabhan
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the 1st question the answer "E. A synchronized method cannot be overridden." is not one of the correct answers, so it's not conflicting
with the explanation of the 2nd question.

Cheers,

Gian
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
REAL QUESTIONS not allowed on this Site!!!

Or is this a mock exam question? If so which mock exam?
[ November 10, 2006: Message edited by: Barry Gaunt ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic