Java : Lesson 001
Posted by argonzdcc on November 7, 2009
Ok guys.., I will try to write java code and than I explain line by line. For this session we start from basic lesson. I hope you will follow me, because I will write java code until Network class, and some class have to know if we want to be expert in java. I will try to write frequently three times a week. So don’t miss it. Okay lets begin our lesson.

Explanation :
Line 1 : import java.io.*;
its mean that we include class java.io into this small program where java.io Contain function for input and output like “println” we will learn about another function latter. Star mean that we include all kind of java.io, because java.io contain many class like DataInputStream. We will learn more about classes in java.io. and semicolon (;) mean we have to write semicolon for every statement in java languange. Its like C++, PHP and pascal
Line 2 class HelloWorld {
It’s mean that our class name is HelloWorld and we put {, its for open the block for class HelloWord, because every class contain some listing, may be contain another class or contain statement, etc.
Line 3 public static void main (String [] args)
It’s a important function, our program can’t run without this function (function main). This function is public. It’s mean another class can read this function by call the name of function. Static mean that character of this function stay in this class. Void mean that this function doesn’t return any value. String [] args mean that this program can receive some arguments when we run the program and the argument is String with array or can be more than one argument.
Line 4 {
It’s for open the statement for function of main
Line 5 System.out.println(“Hello all world occupant”);
It’s a intruction to show sentences that contain between two quatation mark
Line 6 & 7 }
it’s for close the block of function main and class HelloWorld
that’s all for this session. We will meet again in next lesson.