How do you use, call, and access a static method in Java?

Answers were Sorted based on User's Feedback



How do you use, call, and access a static method in Java?..

Answer / 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

How do you use, call, and access a static method in Java?..

Answer / 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

More Core Java Interview Questions

what is instanceof operator used in java?

0 Answers  


What is array in java?

0 Answers  


What is the difference between throw and throws keywords?

0 Answers  


What is the range of the short datatype?

2 Answers  


What is unicode in java?

0 Answers  


Do loops java?

0 Answers  


What is map in java?

0 Answers  


What are the types of inner classes (non-static nested class) used in java?

0 Answers  


What is callablestatement? How you can call stored procedure to pass in parameter?

0 Answers  


Is there any case when finally will not be executed?

0 Answers  


What is the purpose of encapsulation?

0 Answers  


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

0 Answers   Infosys, TCS,


Categories