Home > Software engineering >  New to coding, trying to figure out why this won't work
New to coding, trying to figure out why this won't work

Time:09-30

I was trying to learn how to code through my school, and it got me to put this into notepad , but when I did that, notepad said it had a parsing error. I assume my "{}" are messed up somewhere, but my school ran it fine. I tested it with Online GDB, Notepad , and blueJ. BlueJ wouldn't compile it at all, cmd/notepad returned it as corrputed, and online gdb won't run it because I can't rename the file, and haven't been taught what classes are.

public class HelloWorld 
{

    public static void main(String[] args)
    {
        //prints out a message to the console
      System.out.println("hello World!"); 
    }
}

CodePudding user response:

you've installed Java SE development Kit ?

CodePudding user response:

Try changing the class name from HelloWorld to Main because HelloWorld is public or you can remove public. if you use public than you should call HelloWorld class in a file named HelloWorld.java

  •  Tags:  
  • java
  • Related