Question: how many classes in java files?
Answer: java file can contain only one public class. If you want these two classes to be public they have to be put into two . java files: A. java and B.