what is the difference between statis block and static
variable

Answer Posted / ramakrishna

Static block is the block which is executed first in the
program. Static variable is the common variable which is
shared by all the objects. Static variable is not specific
to any object.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain method local inner classes ?

589


Where are local variables stored?

510


How is hashcode calculated in java?

498


How to retrieve data from database in java using arraylist?

524


What is difference between calling start() and run() method of thread?

555






Why char array is preferred over string for storing password?

584


How many types of constructors are used in java?

534


What are multiple inheritances?

579


Is ++ operator thread-safe in java?

628


How many digits is int32?

534


What is a linkedhashmap java?

547


What happens if main method is not static?

489


What is the largest long allowed by java?

532


What is the exact difference in between unicast and multicast object? Where we will use?

558


define the terminology association.

613