Monday 24 November 2014

Beginning Programming
Structure of a Programming 
Java is an object oriented programming language, so any program that you write must be inside a class. To quickly get started with running Java applications, there are three basic steps
1. Create a class
public class HelloWorld {

}
2. Create a main method inside the class
public class HelloWorld {
public static void main(String[ ] args) {
}}
3. Write the code for the logic
public class HelloWorld {
/* A program to display the message "Hello World" on standard output */
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
The code above is a complete program to print the message "Hello World". Copy paste the code into scratch pad and run it.

No comments:

Post a Comment