I keep having this error and have no idea why and here is my code below.
public class Movie{
private String title;
private int year;
private int price;
private Genre genre;
public Movie(String title, int year, int price, Genre genre) {
this.title = title;
this.year = year;
this.price = price;
this.genre = genre;
}
public Movie() {
}
public String getMovieTitle() {
return title;
}
public int getMovieYear() {
return year;
}
public int getMoviePrice() {
return price;
}
public Genre getMovieGenre() {
return genre;
}
public void setMovieTitle(String title) {
this.title = title;
}
public void setMovieYear(int year) {
this.year = year;
}
public void setMoviePrice(int price) {
this.price = price;
}
public void setMovieGenre(Genre genre) {
this.genre = genre;
}
public String toString() {
return this.year + "\t" + this.title + "\t" + this.genre.toString() + "\t" + "$ " + this.price;
}
}
and then i got this error:
which is a NoSuchMethodException.
I searched about this error, which teached me to add an empty constrcutor and i added it and still got this error. Also, i have all parameters required, why am i still getting this Exception?
can someone help me out pls?
thanks in advance.