Tuesday, August 25, 2015

Your first program

Being a programmer there is one thing you need to do WRITE CODE and the more you write.. the more perfect you get.
In this section, my plan is to lead you into the world of Java programming by writing a simple program. As with any application, you need to be sure that Java is properly installed on your computer(Follow the steps of my previous post).
I have written a HelloWorld example below. I can understand if you can't understand a bunch of things right now but you sure will. For now if you are ready with your Eclipse, just go and type this in your screen.After writing, just right click your button and you can see RUN AS and when you hover there comes a button like  "1 Java Application", just click that and you are good to go.
  1. //Java Hello World example.
  2. public class HelloWorldExample{
  3.   public static void main(String args[]){
  4.      //Use System.out.println() to print on console.
  5.    
  6.     System.out.println("Hello World !");
  7.   }
  8. }
  9. //OUTPUT of the above given Java Hello World Example would be :
  10. Hello World !

No comments:

Post a Comment