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

Answer Posted / glibwaresoftsolutions

The static keyword does not have to appear before the method name.
Like any generic method, call a non-static method.
• Any static variable or method can be accessed by non-static methods without requiring the creation of a class instance.

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 the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

890


How do you convert an int to a double in java?

818


What are white spaces in java?

769


What comes to mind when someone mentions a shallow copy in java?

907


How do you sort a string in alphabetical order in java?

759


What are abstract classes and anonymous classes?

870


What is the difference between a factory and abstract factory pattern?

912


Write a program to show whether a graph is a tree or not using adjacency matrix.

867


Which class contains a method: cloneable or object?

789


What are the restrictions that are applied to the java static methods?

774


Explain the available thread states in a high-level?

739


What is the purpose of the system class in java?

788


What is the difference between error and an exception?

796


How does indexof work?

740


What are the advantages and disadvantages of reference counting in garbage collection?

791