Why there is no static class in Java

前端 未结 5 814
死守一世寂寞
死守一世寂寞 2021-01-14 16:52

I am new to java. When I was going through language specification I found that static classes cannot be declared, but we can have static inner classes. I am little confused

5条回答
  •  -上瘾入骨i
    2021-01-14 17:47

    A top-level class is by definition already top-level, so there is no point in declaring it static; it is an error to do so.

    Static class declarations

提交回复
热议问题