Showing posts with label Parent Class for Student Class. Show all posts
Showing posts with label Parent Class for Student Class. Show all posts

Saturday, 30 July 2011

Concept of Inheritance in Java


//create a class Human  in java
class Human{
String Name;
int Age;
public void setAge(int a){
Age=a;
}//end of set
public int getAge(){
return Age;
}// end of get

public void setName(String n){
Name=n;
}// end of set

public String getName()
{
return Name;
}// end of get


}//end of main class