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


Please Help Members By Posting Answers For Below Questions

What is the difference between a checked and an unchecked exception?

758


What is meant by call by reference?

749


Is cout buffered?

888


What do you mean by multithreaded program?

770


What is the best definition for data?

723


What is the difference between keyword and identifier?

791


How to calculate the length of a singly linked list in java?

778


What is exception propagation?

835


java program with complete 4 oops concepts implemented example

2928


What is static in java?

786


When do we need to use internal iteration? When do we need to use external iteration?

841


Tell me about your ability to work under pressure

1956


What is anagram number?

652


How to use arraylist in java netbeans?

737


Why we use protected in java?

735