What Is Java Programming?

Just as a quick refresher, Java is a programming language that allows you to provide instructions to a computer, and with which you can create computer programs. The computer will then compile the instructions, or program, that you wrote; inform you of errors, if any; and if there are no errors, will execute the instructions in your program.

In order to be able to write and run Java programs, you first need the Java compiler installed on your computer. Once you have the Java compiler successfully installed, you can write, compile, and run a Java program.

Compiling code means using the Java compiler or program that translates the code that's written by humans in Java language to machine or computer language. All programming languages have to be compiled so that the computer can read the code and execute the instructions.


code:-
 
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}

output:-
Hello, Wolrd!


Name of the Java Program

class HelloWolrd{
}

Main Method

This statement is called the main method and should be included in every Java program. This tells the Java compiler that this is the beginning of the Java program. The program then executes all the statements following the main method. The words 'public' and 'static' can be interchanged, (as you see here) but the norm is to write 'static' following 'public.'


static public void main (String[] args) {

}


print  method

 System.out.println("Hello, World!"); 

it is predefined method in java

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post