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...

why top level class could not be static

Answer Posted / sanket mehta

static keyword is meant for providing memory and executing logic without creating Objects, a class does not have a value logic directly, so the static keyword is not allowed for outer class

If you declare the outer class as static, it will not allow to compile giving : Illegal modifier for the class classname; only public, abstract & final are permitted

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 struts in java?

1048


How will you invoke any external process in java?

1124


Can an object be null?

975


Explain about the main() method in java?

1117


What is the purpose of format function?

1185


What is the difference between heap memory and stack memory?

1080


Is it necessary for the port addresses to be unique? Explain with reason.

1022


Why do we use regex?

1038


When should you use arraylist and when should you use linkedlist?

936


What about interrupt() method of thread class ?

1076


Why we used vector class?

1076


What is the use of default method in interface in java? Explain

1011


Is string is a data type in java?

1077


Why main method is static in java?

1188


What are the restriction imposed on a static method or a static block of code?

1060