Writing your first program in Java

We are going to write a simple “Hello World” program in Java.

  1. The code

2.  Save as Hello.java (the file name has to be same as class name. the name is case sensitive. Save the file in a specific folder say desktop.

3. Open command from run and navigate upto the folder where you saved the Hello.java file.

4. compile ta .java file using javac command.

5. Run the bytcode file using java command.

Check the following DOS command:

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *