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 difference between Heap and Stack Memory?
How to stop a thread in java? Explain about sleep () method in a thread?
What are the uses of final, finally and finalize in java?
2 Answers Agiline, FINO PayTech, HCL,
How to synchonise HashMap
Is a method a function?
How do you declare a string variable?
How a class can implement an interface?
What is 16 bits called?
use of wrapper classes?
What is meant by controls and types?
Difference between Web-based applications,Client- Server applications and Distributed applications?
whst is encapsulation?when u encpsulate actually while devoloping code?