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

Name some OOPS Concepts in Java?

1134


Explain wrapper classes in java?

1058


Is there any difference between synchronized methods and synchronized statements?

1137


What are the types of methodology?

1152


What is the size of boolean variable?

1131


What is nextint java?

1128


Describe method overriding

1178


How do you create a reference in java?

1024


What is the difference between the paint() and repaint() methods in java programming?

1236


Is vector synchronized in java?

1053


What are the changes in java.io in java 8 ?

1080


Why does java does not support multiple inheritance? Explain

1037


Can we create object of inner class in java?

996


Explain about object oriented programming and its features?

1066


How does queue work in java?

1025