April 2019
Intermediate to advanced
360 pages
9h 17m
English
The User class, shown here, is abstract and has three class variables. A default constructor has been added. In addition, the computeCredits() method has been made abstract and therefore cannot have a method body:
public abstract class User { // class variables private String name; private String userID; private int downloadCredits; // constructor public User(String name, String userID, int downloadCredits) { this.name = name; this.userID = userID; this.downloadCredits = downloadCredits; } // abstract method public abstract int computeCredits();
The second half of the User class is provided in the following code block. It contains the accessor and mutator methods for each of the three class variables: ...
Read now
Unlock full access