I'm working on a simple project using Interfaces, but I am having an issue making my class conform to the interface.
My thought process is that since Article implements IDedObject, I should be able to pass an Article as a parameter in my overridden functions within my Article Class definition. Unfortunately this throws the error "The type Article must implement the inherited abstract method IDedObject.getID()"
Interface
public interface IDedObject{
public int getID(IDedObject object);
public void printID(IDedObject object);
}
Class
public class Article implements IDedObject{
private int articleID;
private String articleName;
private String authorName;
@Override
public int getID(Article article){
return article.articleID;
}
@Override
public void printID(Article article){
System.out.println(article.articleID);
}
}
What is missing or incorrect?