13:ConstructorsCreate a Java class (program) named MovieTicket. See the Section Things to know this week.It should include the attributes below;A. String movieTitle //Set this to default to null.B. LocalDateTime movieDateTime // Set this to default to null. This requires the line import java.time.LocalDateTime;C. int seat . // Set this to default to 0.Use Eclipse to generate Setters and Getters for these items. – See the Section Things to know this week.Use Eclipse to generate a toString method for this class – See the Section Things to know this week.Create a method in this class named isValid() that returns a boolean result. This method should return true only if seat != 0 and movieTitle is not null. Otherwise it must return false.Create 3 constructors for this class. See Section 11.3 – More Constructors – page 174-175 in the text book.1. A constructor with no arguments. This code does not need to do anything. However, because the other constructors exist – this needs to be coded.2. A constructor that would set movieTitle, movieDateTime3. A constructor that would set movieTitle, movieDateTime, and seat.***In the main method, do the following:You must create a reference for the MovieTicket objects and use the constructors that you created.The LocalDateTime object can be created and used in all the tasks below:LocalDateTime myTime = LocalDateTime.now() ;Create an instance of MovieTicket using constructor 1 and display the instance’s toString() and isValid() result.Create an instance of MovieTicket using constructor 2 and display the instance’s toString() and isValid() result.Create an instance of MovieTicket using constructor 3 and display the instance’s toString() and isValid() result.Sample OutputMovieTicket [movieTitle=null, movieDateTime=null, seat=0] – IsValid = falseMovieTicket [movieTitle=Alita, movieDateTime=2019-04-17T19:10:02.112, seat=0] – IsValid = falseMovieTicket [movieTitle=Alita, movieDateTime=2019-04-17T19:10:02.144, seat=55] – IsValid = true
We offer the best custom paper writing services. We have done this question before, we can also do it for you.
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How It Works
- Click on the “Place Your Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.