Ads 468x60px

Saturday, October 2, 2010

How To Be a Java Programmer


Do you want to be a Java Programmer? Then first you have to be equipped with the tools nessesary for java programming. First thing you will need is a computer (Duh!) , the JDK (JAVA Development Kit), and a good old IDE (Integrated Development Environment)

Programming in java, you could use any of your favorite notepad editor and hack away your code, but in my experience that would be a very long error prone process. So if you want to be a professional Java programmer you will have to choose your tools wisely. My favorite IDE (Integrated Development Environment) for java would be the Eclipse IDE for Java.


There are a lot of Java IDE's out there, but i will list only 3 of the most famous ones:
  • Intellij IDEA - i have not used it but it is very famous and widely used. You can get it here 
  • Netbeans IDE – another very good IDE, with very good UI designer. I like using it but my favorite is Eclipse. The best thing about them is they are both free. You can get it here 
  • Eclipse IDE – a customizable and portable IDE, just unpack it to any folder and you are ready to go. get it here 


Well, before we delve into the mysterious world of java, I would like to introduce it to you with a simple “Hello World” tutorial. For this tutorial we will be using my favorite IDE Eclipse.

First Step is to setup our JDK and our IDE.

Download and install the JDK from here. 

also, download the Eclipse IDE and unpack it to the folder of your choice.


Running Eclipse for the first time it will ask you to choose a workplace. Once Eclipse is running First thing we have to do is click make a new project.

Click on File... then select New... then click on Java Project....

Choose a Project Name and click Finish...

Now you have your project... we can start coding... :D

Right click on the src folder and choose New... then choose Class

then choose your Class Name and Package name. In our case use
Package -> com.wfdb
Class Name -> HelloWorld
then click on Finish...

Our new Class file will now look something like this...

Now we add code to our Class...

<code>
public static void main(String[] args){
System.out.println("Hello World!!!");
}
</code>

public static void main(String[] args) {
      // your code here
}
this piece of code tells java that our program will start executing from this part of the code...

System.out.println("Your Text Here");
this piece of code tells java to print a piece of string out to our console...

Now we run the code... 
Right click on our HelloWorld.java class file from our project and click on Run As... And choose Java Application...

Our result should look like this....


Now, there you have it. Your very first Java Program....

Welcome to the wonderful world of java...

More advanced tutotials soon to come... :D






2 comments:

  1. nice one java boy.. keep it going. Lagyan mo rin ng Adsense at Donate paypal para kumita ka :)... meron rin ako kaso di ko na re-read-proof, pupublish ko nexzt time.

    cyianite

    ReplyDelete
  2. Thanks cyflex... di na ako masyado nakakapag post busy kasi... kakaumpisa ko lang sa work ko sa singapore... :D

    ReplyDelete