Modify the Firm example such that it accomplishes its polymorphism using an interface called Payable. I got an error (attached image). How can I solve it? Firm.java: public class Firm { //----------------------------------------------------------------- // Creates a staff of employees for a firm and pays them. //----------------------------------------------------------------- public static void main (String[] args) { Staff personnel = new Staff(); personnel.payday(); } } Clark.java: public class Clark implements Payable { public static void main (String[] args) { public void wages(); { System.out.println("Wages can be paid to the clerks"); } } } Payable.java: public interface Payable { public void wages();
Question: Modify the Firm example such that it accomplishes its polymorphism using an interface called Payable.
I got an error (attached image). How can I solve it?
Firm.java:
public class Firm
{
//-----------------------------------------------------------------
// Creates a staff of employees for a firm and pays them.
//-----------------------------------------------------------------
public static void main (String[] args)
{
Staff personnel = new Staff();
personnel.payday();
}
}
Clark.java:
public class Clark implements Payable
{
public static void main (String[] args)
{
public void wages();
{
System.out.println("Wages can be paid to the clerks");
}
}
}
Payable.java:
public interface Payable {
public void wages();
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images