1

I know we can create multiple classes inside another class with the only restriction that only one public class is allowed in one source file.

package xyz;
public class TheClass{ 
 class SomeClass{ 
     } 
} 
class AnotherClass { }

But is there any difference between the SomeClass and AnotherClass here?

Shad
  • 1,185
  • 1
  • 12
  • 27
  • Related: https://stackoverflow.com/questions/2148686/non-public-top-level-class-vs-static-nested-class – Attilio Nov 19 '17 at 18:18
  • Not covered in the dupe (I think) is the fact that `AnotherClass` is just a non-public class. – Kayaman Nov 19 '17 at 18:18

0 Answers0