No Main class found in NetBeans

前端 未结 16 2448
时光说笑
时光说笑 2020-11-30 08:32

I have been working on an assignment for my class in programming. I am working with NetBeans. I finished my project and it worked fine. I am getting a message that says \"No

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 09:23

    if all that is your code you forgot to close the main method

    everything else sounds good to me

    public class LuisRp3 {
    
    public static void main(String[] args) throws FileNotFoundException  {
    
        java.io.File newFile = new java.io.File("LuisRamosp4.txt");
    
        if (newFile.exists()) {
            newFile.delete();
        }
    
        System.setOut(new PrintStream(newFile));
    
        Guitar guitar = new Guitar(); 
    }}
    

    try that

提交回复
热议问题