Difference between static methods, static variables, and static classes in Java.

Answer Posted / nashiinformaticssolutions

A variable, method, or class can be made static by using the static keyword. A static class cannot be instantiated. When both objects or instances of a class share the same variables, this is referred to as static variables. Static methods are simply methods that refer to the class in which they are written.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you stop a thread in java?

814


What is the purpose of the system class in java?

767


How do you declare an array in java?

744


Can we make main() thread as daemon?

832


Can a private method of a superclass be declared within a subclass?

743


What are the two main uses of volatile in Java?

810


What is an argument in java?

699


What is the ==?

673


Explain features of interfaces in java?

773


What is the common usage of serialization? What exceptions occur during serialization?

807


What is return data type?

780


What are methods of a class?

752


What is string builder in java?

756


what is meant by abstract class?

843


What is the difference between jfc & wfc?

797