Help with the Constructor Java question
Your friend is a cashier at a movie theater. He knows that you are an awesome java developer so he asked you to help him out and create a program that gets movie title, row, and seat information and prints out a new ticket. Complete the existing code by adding a constructor to Ticket class so that it can be correctly initialized. Sample Input Jaws 5 1 Sample Output Movie: Jaws Row: 5 Seat: 1 import java.util.Scanner; class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); String movie = read.nextLine(); int row = read.nextInt(); int seat = read.nextInt(); Ticket ticket = new Ticket(movie, row, seat); System.out.println("Movie: " + ticket.getMovie()); System.out.println("Row: " + ticket.getRow()); System.out.println("Seat: " + ticket.getSeat()); } } public class Ticket { private String movie; private int row; private int seat; //complete the constructor Ticket(){ this.setMovie(""); this.setRow(); this.setSeat(); } Ticket(String m){ this.setMovie(m); } Ticket(int row){ this.setRow(r); } Ticket(int seat){ this.setSeat(s); } public void setMovie(String m){ this.movie = m; } public void setRow(int r){ this.row = r; } public void setSeat(int s){ this.seat = s; } public String getMovie() { return movie; } public int getRow() { return row; } public int getSeat() { return seat; } }