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 are E and PI?
Does windows 10 need java?
What is covariant return type?
Can there be an abstract method without an abstract class?
What is void class in java?
Explain about sets?
Can private members of a base class are inheritable justify?
Why Java is a platform independent language?
Can a class be declared as static?
How finally used under exception handling?
What are the Static and Dynamic Variables? Differentiate them.
What is the difference between synchronized and synchronized block?