Computers and Technology

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 MIN_CAP = 10; static public final int MAX_CAP = 1000; static public final String DEFAULT_DSCR = "(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() { this(DEFAULT_DSCR, MIN_CAP, false, false); } public OldCellPhone(String dscr, int mem, boolean cam, boolean gp) { // not shown } public String toString() { // not shown } public boolean setMemCapacity(int mem) { // not shown }};A programmer decides to make the static DEFAULT_DSCR mutable, removing its final status, as in: static public String DEFAULT_DSCR = "(generic phone)";A mutator is added for this member. Any String whose length is at least 2 characters will be acceptable as a new DEFAULT_DSCR. Check the true statements (there may be more than one correct answer):A. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() < 2 ) { this. newDefault = DEFAULT_DSCR; return false; } this. newDefault = newDefault; return true;B. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() < 2 ) return false; DEFAULT_DSCR = newDefault; return true;C. The mutator for this member will be an instance method. D. If the mutator takes a String parameter, newDefault, a reasonable definition would be: if ( newDefault. length() > 0 ) return false; DEFAULT_DSCR = newDefault; return true;E. The mutator for this member will be a static method.2.Consider the class as partially defined here://class PizzaOrder class PizzaOrder{ // static public members public static final int MAX_TOPPINGS = 20; // instance members private String toppings[]; private int numToppings; // constructor public PizzaOrder() { numToppings = 0; toppings = new String[MAX_TOPPINGS]; } // accessor tells # toppings on pizza, i. e., #toppings in array public int getNumToppings() { return numToppings; } // etc.}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 13:00, giulissaf
Append and make table queries are called queries. select complex simple action i think action
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, jerry1496
If you want to delete an entire word at a time, which key should you press along with the backspace or delete key?
Answers: 1
image
Computers and Technology, 24.06.2019 21:40, imamador6396
Which of these is not a type of socket? aga (alternating grid array) pga (pin grid array) spga (staggered pin grid array) lga (land grid array)
Answers: 1
image
Computers and Technology, 25.06.2019 06:50, pattydixon6
A1-megabit computer memory chip contains many 27 ff capacitors. each capacitor has a plate area of 3.09 ร— 10โˆ’11 m 2 . determine the plate separation of such a capacitor (assume an empty parallel-plate configuration). the characteristic atomic diameter is 10โˆ’10 m = 1 หša, and the permittivity of a vacuum is 8.8542 ร— 10โˆ’12 c 2 /n ยท m2 . answer in units of หša.
Answers: 3
Do you know the correct answer?
Here is an outline for a working class OldCellPhone that has no errors (you may see this exact class...

Questions in other subjects:

Konu
Biology, 08.12.2020 05:30
Konu
Mathematics, 08.12.2020 05:30
Konu
Mathematics, 08.12.2020 05:30
Konu
Chemistry, 08.12.2020 05:30