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 overloading and overriding in java?
What is OOPs & Why?
What is the current version of java?
Can you call a private data from an inner class?
suppose string s1="rajnish"; string s2="bhaskar"; then what will be happend ?
How to display arraylist values in java?
How to make a non daemon thread as daemon?
there are some duplicate values in ArrayList, how U'll get that array with out duplicate?
What is the use of jtable?
What is unicode used for?
Difference between object instantiation and construction ?
When do we use synchronized blocks and advantages of using synchronized blocks?