1

This question has been asked here earlier too. But i did not find it helpful.
It is just based on an assumption. please throw some insight on this.

dexterousashish
  • 373
  • 1
  • 4
  • 18

2 Answers2

8

static classes means there is no reference to an instance of an outer class.

Top level classes cannot have a reference to an outer class, so in a way they are all static classes.

The reason you can't make them static, is there is no other option and the syntax for top level classes was determined before there was a option for nested classes.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
2

Your question doesn't mean anything. Whether an inner class is static or not basically means, is an instance of that inner class associated with a particular instance of the outer class. If a class is not an inner class, it doesn't mean anything to say that it's static or not static.

Dawood ibn Kareem
  • 77,785
  • 15
  • 98
  • 110