Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is static variable and static method?

Answer Posted / aditya

static variables are class variables.They are globally
declared with the keyword "static".They can be intialised at
the declaration time (or) they can be initialised in static
block.They can accessed by using thier class name
(class name.static variable name).Static variables can also
be accessed by the obj name but to make the difference
between the instance variables and static variables they are
accessed using class name outside the class.Static methods
are the methods that can access only static variables,they
can access instance variables also but only through the
object of the instance variables not directly.Their values
are stored in heap memory.Any changes to the static
variables reflect in heap memory.

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 the default value of local and global variables?

1097


What are different types of inner classes ?

1054


How does thread synchronization occurs inside a monitor?

1104


Write a program to print fibonacci series

1161


Give any two differences between C++ and java.

1150


What are synchronized blocks in java?

1185


What is your platform’s default character encoding?

1083


How does hashset work in java?

1127


Does importing a package imports its sub-packages as well in java?

975


What is percentage in java?

1007


What is space character in java?

1114


What are the changes in java.io in java 8 ?

1037


Difference between concurrent hashmap and hashtable and collections

1070


What is meant by bytecode?

1032


What is the basic concepts of OOPS?

1204