aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes mock question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock question" Watch "mock question" New topic
Author

mock question

Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
Hi ranchers,

javabeat mock question

Which of the following statements are true?

A) An inner class cannot be defined as private.
B) Static methods can be overridden by static methods only
C) Static variables can be called using class name.----------
D) Non static variables can be called using class name.

the given answer is C.But why B option is not included?
Anton Uwe
Ranch Hand

Joined: Jan 10, 2007
Posts: 122
Because you cannot "override" static methods...
Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
Yeah Anton. i forgot while attending the mock test that static methods are just hidden(not override) concept.

Thanks for the help.
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Why is option A wrong in the following code I marked a inner Class private



Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
If you read the wording carefully in A, an inner class cannot be defined as private, the statement is false. The question asked which of the statements is true.
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Keith,

You're right. Sorry for my misreading.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mock question