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

Can we create an object of static class in java?

969


What is floor math?

915


What is a treeset in java?

989


What is Session reduplication and how its done?

1981


How do you escape sequences in java?

1006


What is the difference between JDK and JVM?

1180


What restrictions are placed on method overriding in java programming?

933


What is your platform’s default character encoding?

1016


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1050


What are the basic interfaces of java collections framework?

1043


Can a string be null?

924


Explain jdk, jre and jvm?

914


What java ide should I use?

931


Can we change the scope of the overridden method in the subclass?

1313


What is arguments in java?

956