class HelloJava
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Logic
The first time create a program in java, we must first give the name of the class that will be in accordance also with the file name of the program. in this case we give the class is HelloWorld. (Java sensitive to uppercase and lowercase letters). after that there is command public static void main (String [] args) meaning as an opening gate to the program that we will create. The next line System.out.println ('Hello World') indicates that we will display on the screen that is the String Hello World.
As for output will be as follows :
Make it easy? try it at home
Komentar ini telah dihapus oleh pengarang.
BalasHapus