Untitled
//mutators and accessors// //class used to define object// public class Movie { String movName; String movGenre; int movRating; public Movie(String name, String genre, int rating) { movName = name; movGenre = genre; movRating = rating; } public void setName(String name) { this.movName = name; } public String getName() { return movName; } public void setGenre(String genre) { this.movGenre = genre; } public String getGenre() { return movGenre; } public void setRating(int rating) { this.movRating = rating; } public int getRating() { return movRating; } public void print() { System.out.println("Movie Name: " + movName); System.out.println("Genre: " + movGenre); System.out.println("Rating: " + movRating); System.out.println("___________________________"); } }
Leave a Comment