Monday, 19 September 2011

Java tutorial for beginners


In the last Java tutorial for beginners i told you how to install jdk. Now in this Java tutorial for beginners we will write our first program and run it using cmd.

Lets start our fourth Java tutorial for beginners ,first open your note pad and write the following program.


After writing the program save it with .java extension.For example you can save this program like javatutorial.java or helo.java or myfirstprogram.java etc. You will save this program in folder with variable name which you creat in your last java tutorial for beginners. After saving the program open command prompt and type this command cd \ like shown below.


It will take you at very start of your hard drive. Then type dir in command prompt and press enter. It will show you the list of file that your c drive have. There you will see One my folder called test as shown below.


Then type cd test, it will change your directry to test. Now we are in test folder like below.


After doing this you will again type dir and press enter. You will see your file which you have created with .java extention. I have created with youtube.java as you can see below.


Now how will you compile youtube.java? It is very simple to simple, go and type javac youtube.java in command prompt as shown below.


After typing javac youtube.java press anter and again type dir.Now we have apples.class as shown below


What it does? it take java file and convert it in class file. remeber i name my class as apple class. Lets go ahead and type java in command prompt that means run this program and then type name of your class which is apples as shown below.


then press enter you will see output of your program as shown below.


I hope you enjoy will understand this Java tutorial for beginners and if you have any problem in this java tutorial you can email me at this azeemhafeez75@gmail.com or you can leave your comment here. I will solve all your problem which you will face in this Java tutorial for beginners





3 comments:

  1. please visit www.tamililjava.blogspot.com

    ReplyDelete
  2. learn core java tutorials on http://www.weclassmates.com with easy to understand examples

    ReplyDelete
  3. You are doing a great job. You inspire me to write for other. Thank you very much.If any one want to learn java core to advance contact us on 9311002620 or visit our further websites :-https://htsindia.com/Courses/java/core-java-training-course-institute

    ReplyDelete