subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:00
Convert the quartstogallons class to an interactive application. instead of assigning a value to the number of quarts, accept the value from the user as input.
Answers: 2
question
Computers and Technology, 22.06.2019 12:40
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
You know the right answer?
A programmer decides to make the static DEFAULT_DSCR mutable, removing its final status, as in: sta...
Questions
question
Mathematics, 09.12.2020 18:40
question
Mathematics, 09.12.2020 18:40
question
Mathematics, 09.12.2020 18:40
question
Mathematics, 09.12.2020 18:40
question
Mathematics, 09.12.2020 18:40
question
Mathematics, 09.12.2020 18:40
Questions on the website: 13722363