Question: Code should be in Java language Create a class called Show that includes two instance variables-a day (type int) and a month (type int). Do
Code should be in Java language
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] Sh[1] Next, instantiate the array of objects as shown below: day month Sh[0] day Sh[1] 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
