I am getting an error saying my constructor Book(String, int) is undefined. I check everything else and try to redo my programs still has an error. Any solutions of fixing this issue?
Book Class:
public class Book extends SaleItem{
private String author;
private int numPages;
public Book(int code, String title, double price, int quantity, String author, int numPages){
super(code,title,price,quantity);
this.author = author;
this.numPages = numPages;
}
//Getters
public String getAuthor(){
retu this.author;
}
public int getNumPages(){
retu this.numPages;
}
//Setters
public void setAuthor(String author){
this.author = author;
}
public void setNumPages(int numPages){
this.numPages = numPages;
}
//toString
@Override
public String toString(){
String outputBookDes = "";
outputBookDes += "Author: "+ this.author;
outputBookDes += "Number Pages: "+ this.numPages;
retu outputBookDes;
}
}
Dictionary Class:
public class Book extends SaleItem{
private String author;
private int numPages;
public Book(int code, String title, double price, int quantity, String author, int numPages){
super(code,title,price,quantity);
this.author = author;
this.numPages = numPages;
}
//Getters
public String getAuthor(){
retu this.author;
}
public int getNumPages(){
retu this.numPages;
}
//Setters
public void setAuthor(String author){
this.author = author;
}
public void setNumPages(int numPages){
this.numPages = numPages;
}
//toString
@Override
public String toString(){
String outputBookDes = "";
outputBookDes += "Author: "+ this.author;
outputBookDes += "Number Pages: "+ this.numPages;
retu outputBookDes;
}
}
