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 the difference between static block and static
method

Answer Posted / kishore reddy

static{} blocks are executed on its own as soon as the
program starts. i.e before the main method is called where
as static() is called ONLY from another static method ie
main method.

static() has several restrictions:
1. Can ONLY call other static ()
2. MUST ONLY access static data
3. cant refer to super or this

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java beans?

991


How many bytes is double?

967


How many bits is a 64 bit byte?

1073


Why is java called java?

1046


Explain listiterator and methods in listiterator?

1013


What is an object class?

1023


explain what is transient variable in java?

1124


What is a class reference?

1093


Why pointers are not used in java?

1122


Why are parameters used in functions?

1013


Define iterator and methods in iterator?

965


What are the important features of Java 11 release?

1110


What is the purpose of extern variable?

1015


Write a code to show a static variable?

1088


Is int a class in java?

984