Saturday, 27 June 2009

Java Certification Question 0017

Which of the following statements are true?
1) static methods do not have access to the implicit variable called this
2) A static method may be called without creating an instance of its class
3) A static method may not be overriden to be non-static
4) A static method may not be overloaded



Answer :
1) static methods do not have access to the implicit variable called this
2) A static method may be called without creating an instance of its class
3) a static may not be overriden to be non-static
The implicit variable this refers to the current instance of a class and thus and by its nature a static method cannot have access to it.

No comments: