Java is an Object-Oriented Programming Language. It is easy but a little bit complicated to learn for beginners. To write Java code we need a text editor or a Java IDE(Integrated Development Environment) such as Notepad++, Notepad, Netbeans IDE, Visual Studio Code, Eclipse IDE, etc. Also, ensure that java JDK (Java Development Kit) is installed on your computer.

Java Program (“Hello World”)

Step 1: Open your IDE or text editor to write the java code. I use the Visual Studio Code to write my code.

Step 2: Write this code in your text editor.

class MyClass{
    public static void main(String[]args){
        System.out.println("Hello World");

Step 3: Save it with the file name MyClass.java

Compile and Run The Program

To run the java program first, we have to compile it so that the program can change into a computer understanding language.

To compile the java program open your terminal and command prompt and write the following commands.

“Congratulations you wrote your first program in java”

Leave a Reply

Your email address will not be published. Required fields are marked *