A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Joined: Sep 29, 2005
Oct 18, 2005 05:44:00
Can anyone plz tell me why top level static classes are not allowed in
"Failures are pillars of success" - That doesn't mean you go on building pillars
author and iconoclast
Joined: Jul 08, 2003
Oct 18, 2005 05:48:00
What would be the difference between a top-level static class and a top-level non-static class? Or in other words, what would you expect "static" to mean for a top-level class?
[Jess in Action]
Aadi Narayana Reddy
Joined: Oct 17, 2005
Oct 18, 2005 05:56:00
The top level class never be static. IT is language defined.
Class is intended to create objects to make useful. Static things not belong to any object. They have defined like that.
But static inner classes exists, means that that class object can be accessed with out having the object of the top level class.
G.Adi Narayana Reddy,
I agree. Here's the link:
subject: Static Class
About Inner class
Why are Abstract classes with all concrete methods allowed?
y static var r not allowed in INNER CLASSES ?
Why can't we declare Outer classes or Top level classes as static
JAVA doesn't support 'static' classes
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015