What is static variable and static method?

Answer Posted / mallesh

A static variable is a variable who's single copy in memory
is shared by all objects,so any modifications to the static
variable will modify it's value in all objects.

Static variables are created in Method Area part of Memory.

Is This Answer Correct ?    147 Yes 30 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why parsing is done?

505


What is a lightweight component?

596


Is vector ordered in java?

540


What is formatted output in java?

499


Why singleton is not thread safe?

567






Why main method is called first in java?

543


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

8623


Explain hashset and its features?

581


What is the difference between a checked and an unchecked exception?

551


How big is a boolean?

583


How to print nodes of a Binary tree?

1756


What is mnemonic in assembly language?

553


Can variables be used in java without initialization?

552


Can we print null in java?

574


What happens when heap memory is full?

528