I am getting this error message:
Exception in thread \"main\" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Pet.saySomething
You have the following options for Speak, take your pick:
1st
public abstract class Speak{
public abstract void saySomething();
}
2nd
public class Speak{
public void saySomething(){
}
}
3rd
public interface Speak{
public void saySomething();
}
Edit: First of all, you are not using Speak class anywhere. Second, please add the following method in Pet class:
public abstract void saySomething();
If Speak
is a concrete class, it must implement all of its methods, so saySomething
must have a body.
However, it looks like Speak
is more suitable to be an interface. Your Pet
class can implement that interface.