import java.io.*;
class Student
{
private String name;
private String SapID;
public void display(){
System.out.println("Hello From Base class");
}
}
class StudentDetail extends Student{
public void setdata(String s,String r){
name=s;
SapID=r;
System.out.println("Name="+name+" SAPID="+SapID);
}
public static void main(String args[]){
StudentDetail d=new StudentDetail();
d.setdata("Nikhil" , "500017137");
d.display();
}
}
class Student
{
private String name;
private String SapID;
public void display(){
System.out.println("Hello From Base class");
}
}
class StudentDetail extends Student{
public void setdata(String s,String r){
name=s;
SapID=r;
System.out.println("Name="+name+" SAPID="+SapID);
}
public static void main(String args[]){
StudentDetail d=new StudentDetail();
d.setdata("Nikhil" , "500017137");
d.display();
}
}
No comments:
Post a Comment