Page 1 of 1
About Question enthuware.ocpjp.v8.2.1277 :
Posted: Thu Sep 19, 2019 11:53 pm
by karlose2006
Class A should be public for compile
Re: About Question enthuware.ocpjp.v8.2.1277 :
Posted: Fri Sep 20, 2019 12:19 am
by admin
Not really. It is ok to have a non-public class in a file. You might want to try compiling it to confirm.
The rule is that a public class must be in a file by the same name. So, if class A were public, then it had to be in A.java file.