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 are user defined exceptions?
What is the ResourceBundle?
2 Answers Elementus Technologies,
Differences between C and Java?
Write a code to create a trigger to call a stored procedure
What does the @override annotation do?
What class is used to implement a Throwable array?
What is re-factoring in software?
what is the need to set path in java? how many ways to set path in java? Explain breif?
What is array initialization in java?
what are the purposes of native, transiant key words?
What is parse method?
Describe what happens when an object is created in java ?