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 different ways of object creation in java ?
Can you call a method in a method?
What are some examples of variable costs?
Which collection is thread safe in java?
what is an anonymous class?
What data type is true or false?
What are wrapper classes in java?
What is the use of StringTokenizer class?
Does java map allow duplicates?
What is comparator in java?
What is the difference between static binding and dynamic binding?
Can a class be declared as protected?