Search This Blog

Friday, July 17, 2020

Java Basic Program

Hello world Program : -

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



public - is a access modifier.

static- is  a java keyword

void- is a java keyword used to indicate that the method will not return anything.

( )  -- left and right parenthesis is a method declaration are mandatory and can optionally include one or more parameters.

{ } - is called code block, is used to define block of code. it's mandatory to have one in a method declaration and it's here where we will write statements to perform certain task.

statements - statements is the complete command to be executed and can include one or more expression .







No comments:

Post a Comment