What is wrong in the Item class?
public class Item extends A implements B {
private int x;
public Item(int x, double z) {
super(z);
this.x = x;
}
public void start() {
go();
}
@Override
public String toString() {
System.out.println(x);
}
}
public abstract class A {
private int y;
public A(int y) {
this.y = y;
}
public void go() {
System.out.println("Go!");
}
abstract void run();
}
public interface B {
public void stop();
}
}
I figured this problems:
toString() only prints but should return.
There is no implementation of method stop required by interface.
New contributor
Eru is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.