Difference between static and non-static member of a class.

Explain the difference between static and non-static member of a class.

A static member has only one copy of instance variables that share among all the objects of the class whereas a non-static member has its own copy of instance variable.

What is the difference between Static and Non-Static fields of a class in Java?

A static field belongs to a class. The objects of the class can not have the copy of these fields. These fields are referred by the class name. Ex: Employee. company. Without creating an instance of a class, these fields can be accessed.

A non-static field is accessed by all objects of the class. Each object has one copy of non-static field. To use non static fields, an instance of the class should be created.
Describe the use of “instanceof” keyword.
Describe the use of “instanceof” keyword - “instanceof” keyword is used to check what is the type of object......
Disadvantage of garbage collector
What is the disadvantage of garbage collector? - Although garbage collector runs in its own thread, still it has impact on performance. It adds overheads....
What is an Applet?
What is an Applet? - An applet is a small server side application that can be loaded and controlled on the browser by the client..
Post your comment