Question: Assignment 1 Exercise 1 The Java class called Holiday is started below. An object of class Holiday represents a holiday during the year. This class

 Assignment 1 Exercise 1 The Java class called Holiday is started

Assignment 1 Exercise 1 The Java class called Holiday is started below. An object of class Holiday represents a holiday during the year. This class has three instance variables: name, which is a String representing the name of the holiday day, which is an int representing the day of the month of the holiday month, which is a String representing the month the holiday is in public class Holiday private String name: private int day; private String month; // your code goes here a) Write a constructor for the class Holiday, which takes a String representing the name, an int representing the day, and a String representing the month as its arguments, and sets the class variables to these values. b) Write a method inSame Month, which compares two instances of the class Holiday, and returns the Boolean value true if they have the same month, and false if they do not. c) Write a piece of code that creates a Holiday instance with the name "KSA National Day", with the day "23", and with the month September

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!