Multiple classes in single file

前端 未结 8 1646
北荒
北荒 2020-11-29 07:57

I\'m having trouble putting multiple classes into a single file. For example, when my file looks like:

public class FirstClass() {}
public class SecondClass(         


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 08:31

    Just remove public from all other class definition and paste the code into TheaterDemo.java file

    public class TheaterDemo
    {
        public static void main(String[] args)
        {
            TheaterWindow theaterWindow = new TheaterWindow();
        }
    }
    //Here class code after removing public
    
    // Here another class code
    

提交回复
热议问题