-2

File name: Hello world

public class HelloWorld{
    public static void main(String[] args){
        String message = "Hello world";
        System.out.println(message.toUpperCase());
    }
}

And it should work but its says

Replace this use of System.out or System.err by a logger.

I'm using Visual Studio Code and I can't figure out why its not working. Did I do something wrong with setting up VS code?

Thanks

fehailfds
  • 1
  • 2
  • I personally am disgusted by anything "Visual Studio" (pro and community) related. Have to use those regularly. Also tried Visual Studio Code, actually gave it multiple tries. Never EVER been a good experience. So whenever possible, I steer clear of that stuff. MS and its VS(C)s just put in too many MS-specific idiosyncrasies that make handling normal code a pain in the ass. Especially throwing compile time errors when things should only be a warning... – JayC667 Dec 24 '20 at 05:22

1 Answers1

-3

This is a common beginner mistake.

Your code is alright, you just need to fix the filename. Match the filename with the public class declared. Java needs the public class to be named the same as the filename. Fixing that should fix your error.

Name the file HelloWorld and you are good to go.

ribbas
  • 14
  • 1