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

Why do we use predicate in java?

1015


What is java argument list?

893


What is difference between final and immutable?

1096


What is the benefit of abstract class?

903


Explain runtime exceptions?

1136


What are the access modifiers in java?

1000


Can I learn java without any programming experience?

998


Why is java called java?

997


Write a program to reverse a number in java?

1057


What are different types of control structures?

938


Is it compulsory for a try block to be followed by a catch block in java for exception handling?

969


What is one third plus one third as a fraction?

880


What 5 doubled?

937


Explain spliterator in java8?

1014


What is meant by stack and queue?

1019