MenuBar

Saturday, 2 April 2011

tutorial no1: intro java

Java is completely object orianted programing language.To learn java you should know what are classes and what is meant by objects.That is all you need to know. but if you do not know even that then check out this link
in  c++ we build objects of classes like this
className obj;
in java we need some thing called reference to hold  our object. and object is created with new keyword
className ref = new className();
new is a keyword and is used to make new objects of a class. to use the object we make references to our objects in this case ref. For Example, if we want to change some thing in our object, then you should make changes in reference. you can say that our reference is pritty much synchronized to our object.The Type of our reference and object should be the same, for Example if object created is of type student, then we need a reference of type student to hold it.
Now, we are good to move ahead. Next we will see what area pakages ? pakages area pritty much like group of similar classes for reusing.In java we have many pakages each contains many classes.
to use any class we need to import  that pakage. here is a sytentex  to import java pakages.

import  java.util.Math;
here i am using Math class fron pakage java.util . And for some purposes, you need  to import many classes (almost all classes in pakage) we do this
import  java.util.*;
* mean that i am going to import  all the crap from pakage java,util.
to know more about pakages follow this http://www.facebook.com/album.php?aid=24413&id=112774328797887&saved link . this will make things even simpler :-)

now, we will make our first first java console application obviously helloworld :p
follow this http://www.facebook.com/note.php?created&&note_id=122006964541290#!/notes/mr-java/helloworldjava/122006964541290   try this out . so see you hoss good bye take care. i am outta here



No comments:

Post a Comment