First Code in Java
First Code in Java
Choosing a Theme
On the first launch of VS Code, you will be asked to choose a theme according to your
preference. We will choose the dark theme. After opening the editor, you will see several
icons on the left panel of the screen:
Creating a Project
java -version
javac -version
System.out.println("Hello, World!");
o Whenever we write text inside the braces, we need to put it in double quotes.
For numbers, we just write them as they are.
o Press Enter, and you will see the console displaying "Hello, World!".
If we try to compile and run the single line System.out.println("Hello, World!"); in a Java
file, it will give errors.
We will explore the errors and their meanings in the next chapter.