• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help an explanation please

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic