Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is an outline for a working class OldCellPhone that has no errors ( you may see this exact class several times in this exam
Here is an outline for a working class OldCellPhone that has no errors you may see this exact class several times in this exam:
class OldCellPhone
static public final int MINCAP ;
static public final int MAXCAP ;
static public final String DEFAULTDSCR generic phone;
private String description;
private int memCapacity;
private boolean camera;
private boolean gps;
public void setCamera boolean hasCam camera hasCam;
public void setGps boolean hasGps gps hasGps;
public OldCellPhone
thisDEFAULTDSCR MINCAP, false, false;
public OldCellPhoneString dscr int mem, boolean cam, boolean gp
not shown
public String toString
not shown
public boolean setMemCapacityint mem
not shown
;
A programmer decides to add a method addMemory whose job it will be to increase the private int memCapacity by an amount specified by the client as long as the new, increased memory capacity after increasing it is still MAXCAP. Otherwise, it will not touch memCapacity.
Check the true statements there may be more than one correct answer:
Group of answer choices
This should be a static method.
This should be an instance method.
If correctly defined, a client could add units of memory to the OldCellPhone object, myCell, by using the syntax:
OldCellPhone.addMemory;
If correctly defined, a client could add units of memory to the OldCellPhone object, myCell, by using the syntax:
OldCellPhone.addMemory myCell;
If correctly defined, a client could add units of memory to the OldCellPhone object, myCell, by using the syntax:
myCell.addMemory;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started