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

What is thread start?

611


What is the exact difference in between Unicast and Multicast object?

1616


Implement two stacks using a single array.

658


What are the data types supported by java? What is autoboxing and unboxing?

640


Is void a type?

660






What is a nested structure?

616


Can inner class final?

749


What is the difference between the final method and abstract method?

631


design an lru cache in java?

632


What is method overloading and method overriding?

636


What is classpath?

639


What restrictions are placed on method overloading?

730


What is use of set in java?

585


Write a program to search a number in the given list of numbers.

717


Why enumeration is faster than iterator?

614