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 |
Do you know how to reverse string in java?
How do you define a singleton class?
What is the symbol for space?
Can a class be protected in java?
Explain static nested classes ?
What is difference between local variable and global variable?
how do I create a runnable with inheritance? : Java thread
what is check p object in java
How to sort a vector elements that contains the user define class object? (Note: If Suppose consider, A Student class contain two data members. They are String studentName and int rollNo. I am creating Four objects for this class, each object contains students details like name and roll no. Now i am storing that objects in vector and if i retiving the elements from the vector means then it should be display in sorting order)
3 Answers ProdEx Technologies,
what is the difference between ArrayList and Vector
19 Answers KPIT, Sasken, Satyam, Span Infotech, Wipro,
What is the difference between the synchronized() & static synchronized()?
What is local variable and instance variable?