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 full meaning of java?
What is difference between static variable and global variable?
What are the two types of exceptions in java? Which are the differences between them?
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
What is the replace tool?
What does system out println () do?
Are arrays dynamic in java?
Where is the singleton class used?
Does java support function overloading, pointers, structures, unions or linked lists?
What is ‘has a’’ relationship in java?
What is java util function?
Explain the concept of proper inheritance?
Give example to differentiate between call by value and call by reference.
What is the destroy method?
Can a class be protected in java?