Skip to content
Snippets Groups Projects
Commit f90cf2d1 authored by Mathea Berg Vindsetmo's avatar Mathea Berg Vindsetmo
Browse files

lf of5_2

parent cd586a13
No related branches found
No related tags found
No related merge requests found
package of5_2.lf;
public class Dog implements Animal {
private int age;
private String name;
public Dog(String name, int age) {
this.name = name;
this.age = age;
}
@Override
public String getName() {
return name;
}
@Override
public int getAge() {
return age;
}
@Override
public String makeSound() {
return name + " sier bjeff!";
}
@Override
public int compareTo(Animal other) {
return this.getAge() - other.getAge();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment