Question: Create a class called Show that includes two instance variables-a day (type int) and a month (type int). Do not provide any constructor. Provide a
Create a class called Show that includes two instance variables-a day (type int) and a month (type int). Do not provide any constructor. Provide a method that initializes the two private instance variables and assume that the values provided are correct. Provide a method toString() that displays the day and month values. Write a test application named ShowTest that demonstrate class Show capabilities. Add a main method to the showTest class. In the main method declare an array of Show objects with 2 null references as shown below: Sh[0] Sh11 Next, instantiate the array of objects as shown below: day month Sh[0] Shf 11 day month Finally, call the appropriate methods to get the following output: For Array Element Sh[0] Value of day = 10 value of month = 9 For Array Element Sh[1] Value of day = 7 Value of month = 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
