aspose file tools*
The moose likes Mock Exam Errata and the fly likes JavaCaps mock 1 Q:39 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "JavaCaps mock 1 Q:39" Watch "JavaCaps mock 1 Q:39" New topic
Author

JavaCaps mock 1 Q:39

Haining Mu
Ranch Hand

Joined: Jun 01, 2001
Posts: 51
39. 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.
Answer:BC
For B, are we saying static method can NOT be overridden. They are just happen to have the same return type, method name, para list if we see two static methods in two classes, right?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The rule is that static methods can not be overridden to be non-static.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Haining Mu
Ranch Hand

Joined: Jun 01, 2001
Posts: 51
Originally posted by Thomas Paul:
The rule is that static methods can not be overridden to be non-static.

not quite get it. Mughal's book p181 says 'Any final, static and private methods in a class cannot be overridden'. And in JLS 8.4.6, for static method, it is called 'hiding' not overriding respect to instance method. What we do it havaing such a problem in SCJP exam?
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Haining,
There's a good chance you won't see a question with similar wording on the real exam. The exam is based on the rules in the JLS; not partial or misleading information.
[This message has been edited by Jane Griscti (edited June 17, 2001).]


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
junaid rehman
Greenhorn

Joined: Jun 17, 2001
Posts: 16
the answer of the first answer is correct or not
can any pls explain more
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Juanid,
'static' methods belong to the class. Overriding involves 'objects' or 'instances' of a class so technically a 'static' method cannot be overidden although a static sub-class method may 'hide' a superclasses static method.
See the Sun Tech Tip Shadowing
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Jane Griscti (edited June 17, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaCaps mock 1 Q:39