Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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; I/ your code goes here 1 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 inSameMonth, 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) A toString method that returns a string representing an object. d) Write a HolidayTest class to test the constructor, inSameMonth and tostring method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions