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 char and char *?
How does serialization work
Can we place the any object to key attribute of HashMap<key,value>?
What is procedure writing?
Can we create our own daemon thread?
What is singleton class in java and how can we make a class singleton?
what is an anonymous class?
Is call by reference possible in java?
What we have to do, when we don't want to implement all methods of an interface?
What is the difference between add() and addElement() method in Vector Class ?
What do you meant by active and passive objects?
Is java 11 paid version?