Here is a Java program to display the message "Hello World!". Don't expect to understand what's going on here just yet -- some of it you won't really understand until a few chapters from now:
// A program to display the message
// "Hello World!" on standard output
public class BSIT // All programming in Java is done inside "classes."
{
// Public: It is an Access modifier
// Static: It is a keyword which is when associated with a
// method, makes it a class related method.
// Void: method doesn’t return anything.
// main: It is the name of Java main method.
// String[] args: It stores Java command line arguments
//the name of the String array is args but it is not fixed
// and user can use any name in place of it.
public static void main(String[] args)
{
System.out.println("Hello Bosywillcode!");
}
}
No comments:
Post a Comment