Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package p2;
- import person.Car;
- import person.Person;
- public class Student extends Person implements Helper{
- int studentId;
- public Student(int id, String name,int studentId) {
- super(id, name);
- this.studentId = studentId;
- }
- @Override
- public void show(int d) throws Exception{
- super.show(23);
- System.out.println(this.studentId);
- }
- @Override
- public void show2(int s) {
- System.out.println("dhdh");
- }
- @Override
- public int compareTo(Helper o) {
- if(this.getId()>((Student)o).getId())
- return 1;
- if(this.getId()<((Student)o).getId())
- return -1;
- return 0;
- }
- @Override
- public String toString() {
- // TODO Auto-generated method stub
- return this.getName()+" "+this.getId()+"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement