How to call static method?
Answers were Sorted based on User's Feedback
Answer / maharajan j
Static methods we can call without class reference.We don't
need to create an object of that particular class.
For example:
class A{
static void disp(){
sysout("Java")
}
}
class B{
B(){
A.disp();
}
}
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / ranganathkini
A static method may be called in 2 ways:
1. Thru the class reference
2. Thru the instance reference of the class
| Is This Answer Correct ? | 6 Yes | 2 No |
What is the difference between method and constructor ?
What are 3 boolean operators?
Is treeset sorted in java?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
What happens if we don’t override run method ?
What is run time polymorphism?
6 Answers eClerx, Elementus Technologies,
What are format specifiers in java?
What do the thread?class methods run() and start() do?
What is synchronization and why is it important in java programming?
Explain the access modifiers for a class, method and variables?
Should a main method be compulsorily declared in all java classes?
What is the difference between Access Modifier and Access specifier?