How do you use, call, and access a static method in Java?
Answer Posted / nashiinformaticssolutions
• 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 method reference in java 8?
What is the common usage of serialization? What exceptions occur during serialization?
How can we make copy of a java object?
What is square root in java?
Is there any limitation of using inheritance?
What do you understand by private, protected and public?
Does collectionutils isempty check for null?
Is singleton class immutable?
What is assembly condition codes?
What is the program compilation process?
What is a two-pass assembler?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
Why declare Main() method as a static in java ?
Why does java does not support multiple inheritance? Explain
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.