Wednesday 20 July 2011

Java Lecturer Basic

Java is an object Oriented Language, Object are things in real world for example Human is an object because Human has both Properties and Function. That is an  a Human will have  Name, age, Height act as properties and Eating , Seeing, and Walking will  be the function performed by the Human, I can say that If I make a Human Class in Java. It will have Name, Age, and Height as attributes or properties. And the Eating (), seeing (), Walking () will act as the function of the Human Class. On the basis of this class I can make many objects of Human Class. The Simple syntax of Human class will be as follows.

class Human{
String Name;
int Age;
int Height;


setName(String name){ Name=name;}

setAge(int a){Age=age;}

setHeight(int h) {Height=h;}

}

No comments:

Post a Comment