Multiple Choice
Insert the missing statement(s) in the following code fragment. The code is intended to display a message "Your cost is: " in a text area and display the cost on the next line.
Double cost = 500.99;
String message = "Your cost is:";
JTextArea result = new JTextArea(10, 30) ;
__________________________________________
Result.setEditable(false) ;
A) result.setText(message) ;
Result.append(cost) ;
B) result.addText(message + "\n" + cost) ;
C) result.append(message + cost) ;
D) result.setText(message + "\n") ;
Result.append(cost) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q9: Which of the following statements creates a
Q10: Which statements will create an editable text
Q11: When an event occurs, the event source
Q12: Which of the following statements about listener
Q14: Consider the following code snippet that is
Q15: An inner class can access local variables
Q17: Which statement will add a dollar sign
Q18: A/an _ object contains methods that describe
Q53: The methods of a/an _ describe the
Q82: How do you specify what the program