public class Human {
private String name;
public Human(String name){
this.name = name;
}
public String getName(){
return name;
}
public String toString(){
return "Human " + getName();
}
}
interface Electrician{
public String changeBulb();
}
interface Plumber{
public String unplugDrain();
}
class HandyPerson extends Human implements Electrician, Plumber{
public HandyPerson(String name){
super(name);
}
public String changeBulb(){
return "HP: Unscrew old one replace new 1";
}
public String unplugDrain(){
return "HP: Use plunger";
}
public String toString(){
return "HandyPerson " + getName();
}
}
class NobodySpecial extends Human{
public NobodySpecial(String name){
super(name);
}
public void changeBulb(){
System.out.print("NS: Unscrew old, screw in new");
}
public void unplugDrain(){
System.out.println("NS: Use plunger");
}
public String toString(){
return "Nobody Speacial " + getName();
}
}
class IndustrialPlumber extends Human implements Plumber{
public IndustrialPlumber(String name){
super(name);
}
public String unplugDrain(){
return "IP: We'll add in to out list";
}
}
i got this on a tutorial website..but a error comes. I know that i should insert a main function but where should i insert? @.@