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 are the limitations for static method?

Answer Posted / puneet

Static in context of java is something which is executed at
the time when the class is loaded by either bootstrap loader
or another loader into memory.These are basically for
initializations of the variables which wil be used by all
the instance variables.Say we need ot restrict how many
objects whill be created of the class store the no.of
objects created in a static variable and everytime the
object is called thestatic variable is incremented and as
soon as it reaches a limit restrict it by some logic.

The static methods can be called by the object refrence of
the class or the class name, they cannot use instance
variables or instance methods, they are the part of the
class and not instance, the static variables are stored in
registers and remain in the memory as long as the clas in
unloaded.

Is This Answer Correct ?    10 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of voids are there?

1022


Explain thread life cycle in java?

1089


What is the base class of all exception classes?

1119


Can you achieve runtime polymorphism by data members?

1191


What is the use of :: in java?

1074


What are the types of methods in java?

1174


Write a program in java to establish a connection between client and server?

1015


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

1133


Which java version is latest?

1084


What is a byte string?

1166


What is final access modifier in java?

1207


What is an infinite loop in java? Explain with an example.

1110


How do you add an element to an arraylist in java?

994


How many decimal places is a double?

1035


What is generics in java interview questions?

1137