What is static variable and static method?

Answer Posted / bijeesh.p

A static variable ,also reffered to as a class variable
which exists across instances of a class.
By default,all variables are created as instance
variables(A variable related to a single instance of a
class.Each time an instance of a class is created,the
system creates one copy of the instance variables related
to that class).To make a class variable,you must explicitly
declare the variable static.

Is This Answer Correct ?    16 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java call by reference?

618


How to declare an arraylist in java?

563


Can we call thread start () twice?

594


Is vector thread safe in java?

653


What are the advantages of functions?

601






What makes a function well defined?

640


What are the rules for naming an array?

611


What is array length?

582


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

602


Assume a thread has lock on it, calling sleep() method on that thread will release the lock?

738


Which access specifier can be used with class ?

615


What is the main functionality of the remote reference layer?

1515


What is t in generics in java?

666


What are the methods of object class ?

655


How is abstraction implemented in java ?

613