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
Explain a few methods of overloading best practices in java?
Which is better 64 bit or 32 bit?
What are the differences between stringbuffer and stringbuilder?
What is a control variable example?
Wha is the output from system.out.println(“hello”+null); ?
Can you run java program without main method?
What is a databasemetadata?
How do generics work in java?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
What is the difference between the direct buffer and non-direct buffer in java?
Why are data types important?
What is double parsedouble in java?
How to remove the trailing spaces from a string?
What is the purpose of a parameter?
How do you access command-line arguments within the code?