Monday, February 2, 2015

Excercise Solution 1

1. Write a program in java to print or display "Hello World".
class User{
       public static void main(String[] args){
              System.out.println("Hello World");

Save the above code into a file, let us say
Compile the source file from the command prompt:
Now you will have two files, one is your source file and another one is the compiled file namely User.class
Now execute your newly born class as follows and watch the output on next line.
prompt>java User
Hello World

Back to Exercise