class is abstract; cannot be instantiated
I am very confused as to what I am supposed to be doing. The instructions for this assignment are as follows:
15.04 Assignment Instructions
Instructions: For this assignment, you are going to modify the classes you have made in the second assignment, to implement Comparable<t>.
1. Create a folder called 15.04 Assignment in your module 15 assignments folder.
2. You are to create an abstract class called Homework3.
a. It will be same as Homework2, but also implement Comparable<Homework2>.
b. It will implement compareTo() using the number of pages. Homework can be ordered based upon the pages that are part of the homework.
c. Save the class as Homework3.java.
3. You are to create a class called MyMath3 that extends class homework.
a. MyMath3 will be the same as MyMath2, except it extends Homework3.
b. Save the class as MyMath3.java.
4. You are to create a class called MyScience2 that extends class homework.
a. MyScience3 will be the same as MyScience2, except it extends Homework3.
b. Save the class as MyScience3.java.
5. You are to create a class called MyEnglish2 that extends class homework.
a. MyEnglish3 will be the same as MyEnglish2, except it extendsHomework3.
b. Save the class as MyEnglish2.java.
6. You are to create a class called MyJava2 that extends class homework.
a. MyJava3 will be the same as MyJava2, except it extends Homework3.
b. Save the class as MyJava3.java.
7. Create a test program called TestHomework3.java to test your class. Use an ArrayList of type Homework3 to test your class (Remember to declare it properly using List). Demonstrate the results of compareTo().
The output should look like
Math - must read 4 pages.
English - must read 4 pages.
Java - must read 5 pages.
Science - must read 2 pages.
The homework for math and english are the same number of pages.
I have to write some kind of compareTo method that looks like this
It has to apply to this homework assignment and I don't get what the method would be like in this.
public int compareTo(BasicJean2 obj)
if (pantSize < obj.pantSize)
else if (pantSize == obj.pantSize)