How do you use, call, and access a static method in Java?
Answer Posted / glibwaresoftsolutions
• The static keyword needs to appear before the method name.
• Use the class (className.methodName) to invoke a static method.
• No non-static instance variables or methods can be accessed by static methods.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is the swingutilities.invokelater(runnable) method for? : Java thread
Can we call the run() method instead of start()?
What is the use of default method in interface in java?
What is the base class for error and exception?
What is the function of static in java?
What is variable and its types?
How to split arraylist elements in java?
Is finalize() similar to a destructor?
What are the differences between throw and throws?
What is oops in java?
What is java util concurrentmodificationexception?
Explain the selection sort algorithm and state its time complexity?
What is a bubble sort in java?
What is serialization in java?
What are internal and external variables?