34 lines
578 B
Java
34 lines
578 B
Java
package Practice.test;
|
|
|
|
public class human {
|
|
private String name;
|
|
|
|
public human(String name){
|
|
this.name = name;
|
|
}
|
|
|
|
public String getName(){
|
|
return this.name;
|
|
}
|
|
}
|
|
|
|
class Student extends human{
|
|
private int id;
|
|
|
|
public Student(String Name, int id){
|
|
super(Name);
|
|
this.id = id;
|
|
}
|
|
public int getId(){
|
|
return this.id;
|
|
}
|
|
|
|
public static void main (String[] args){
|
|
Student st = new Student("John", 123);
|
|
System.out.println(st.getName());
|
|
System.out.println(st.getId());
|
|
|
|
}
|
|
|
|
}
|