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 constructor chaining in java?
What is the use of singleton class?
Does java map allow duplicates?
Which is best ide for java?
Why java is made?
explain autoboxing in java?
Explain methods specific to list interface?
What are some characteristics of interference class?
How can you reverse a string?
What is encapsulation in java?
Which method will get invoked first in a stand alone application?
what is bytecode ?explain in detail and watz the difference between bytecode and machine code?