subject

Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, and so forth. In addition, provide the following methods:* A no-arg constructor that sets the monthNumber to 1.* A constructor that accepts the number of the month as an argument. It would set the monthNumber field to the value passed as the argument. If a value less that 1 or greater than 12 is passed, the constructor should set monthNumber to 1.* A constructor that accepts the name of the month, case insensitive, such as "January" or "february" as argument. It should set the monthNumber field to the correct corresponding value.* A setMonthNumber method that accepts an int argument, which is assigned to the monthNumber field. If a value less than 1 or greater than 12 is passed, the method should set monthNumber to 1.* A getMonthNumber method that returns the value in the monthNumber field.* A getMonthName method that returns the name of the month. For example, if the monthNumber field contains 1, then this method should return "January" (First letter capitalized and the rest lower-case).* A toString method that returns the same value as the getMonthName method.* An equals method that accepts a Month object as an argument. If the argument object holds the same data as the calling object, this method should return true. Otherwise, it should return false.* A greaterThan method that accepts a Month object as an argument. If the calling object's monthNumber field is greater than the argument's monthNumber field, this method should return true. Otherwise, it should return false.* A lessThan method that accepts a Month object as an argument. If the calling object's monthNumber field is less than the argument's monthNumber field, this method should return true. Otherwise, it should return false.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
This is not a factor that you should use to determine the content of your presentation. your audience your goals your purpose your technology
Answers: 1
question
Computers and Technology, 22.06.2019 21:50
Answer the following questions regarding your system by using the commands listed in this chapter. for each question, write the command you used to obtain the answer. a. what are the total number of inodes in the root filesystem? how many are currently utilized? how many are available for use? b. what filesystems are currently mounted on your system? c. what filesystems are available to be mounted on your system? d. what filesystems will be automatically mounted at boot time?
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
You know the right answer?
Write a class named Month. The class should have an int field named monthNumber that holds the numbe...
Questions
question
Mathematics, 24.09.2021 01:10
question
Biology, 24.09.2021 01:10
Questions on the website: 13722363