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 |
Can a singleton class be inherited?
where do you place after you did code in java
Write program to print Hello World and print each character address in that string and print how many times each character is in that string? Ex: H: 0 & 1 e:1 & 1 l :2,3,8 & 3 o:4,6 & 2 w:5 & 1 r: 7 & 1 d 9 & 1
What is the difference between a checked and an unchecked exception?
What are the performance implications of interfaces over abstract classes?
Explain break statement and continue statement?
What does escaping a character mean?
How many bytes is a string?
What is difference between synchronize and concurrent collection in java?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
Can we define private and protected modifiers for the members in interfaces?
Explain where variables are created in memory?