Right now my program says there is an error in line 27 of this code:
Class Netflix:
public class Netflix
{
private static void main(String[]args)
{
String comedy, horror, drama, action, genre1;
Movie a = new Movie();
a.setTitle("Avatar");
a.setCast("Sam Worthington");
a.setGenre('a');
a.setYear(2009);
a.setStars(3);
Movie b = new Movie ();
b.setTitle("Battle Los Angeles");
b.setCast("Aaron Eckhart");
b.setGenre('a');
b.setYear(20011);
b.setStars(5);
String stars1;
if (a.setStars(5))
stars1 = "*****";
else if (a.setStars(4))
stars1 = "****";
else if (a.setStars(3))
stars1 = "***";
else if (a.setStars(2))
stars1 = "**";
else if (a.setStars(1))
stars1 = "*";
switch (a.setGenre())
This code contains the main method and needs to display movie info:
Class Movie:
public class Movie {
private String title;
private String cast;
private int year;
private char genre;
private int stars;
public void setStars(int stars)
{
this.stars = stars;
}
public int getStars()
{
return stars;
}
public void setYear(int year)
{
this.year = year;
}
public int getYear()
{
return year;
}
public void setGenre(char genre)
{
this.genre = genre;
}
public char getGenre()
{