Multiple Choice
Suppose a phone number, stored as a ten-character string (of digits only) called phoneNumber must be converted into a string that has parentheses around the area code. Which statement below will do that?
A) String newNumber = "(" + phoneNumber.substring(3, 0) + ") ";
B) String newNumber = "(" + ") " + phoneNumber;
C) String newNumber = "(" + phoneNumber.substring(1, 3) + ") " + phoneNumber.substring(3, 7) ;
D) String newNumber = "(" + phoneNumber.substring(0, 3) + ") " + phoneNumber.substring(3, 10) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q8: Which of the following options declares a
Q15: What will be the value inside the
Q16: Assume the following variable has been declared
Q17: What (if any) type of error occurs
Q18: What will be printed by the statements
Q19: Which of the following statements is correct
Q21: What will be the value stored in
Q23: Which of the following guidelines will make
Q54: The assignment operator<br>A)denotes mathematical equality<br>B)places a new
Q66: Consider the following Java variable names:<br>I.1stInstance<br>II.basicInt%<br>III.empName_<br>IV.addressLine1<br>V.DISCOUNT<br>Which of