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 / vatsal doshi

The answer is in the question itself.
What is static? Something which belongs to a class and not its objects.

So if in a class, we have some variables, having single copy, we call them static.
Similarly some methods may be actually manipulating these static variables, so those methods are also static.

However, the class itself is static only if it belongs to some class(Definition of static)

So, for a class to be static, it must be a nested class. Such nested classes are called as Top Level Nested Classes in Java.

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an immutable object?

1035


How can you share data between two thread in Java?

896


Give us the name of the list layoutmanagers in java?

876


Distinguish between a predicate and a function?

939


How to disable caching on back button of the browser?

1004


What is substring 1 in java?

1061


What is java used for?

971


What is square root in java?

1033


What is yield () in java?

834


What is consumer interface?

946


What is your platform’s default character encoding?

1016


Why java is considered dynamic?

1109


What is the difference between iterator and list iterator?

966


What are the features of junit?

995


In java, how we can disallow serialization of variables?

936