Solved

Consider the Following Code Snippet, Assuming That Description Is a String

Question 103

Multiple Choice

Consider the following code snippet, assuming that description is a String and totalPrice is a double:
System.out.printf("%-12s%8.2f",description,totalPrice) ;
Which of the following statements is correct?


A) This code will produce 2 columns, with the description field left justified and the totalPrice field left justified.
B) This code will produce 2 columns, with the description field right justified and the totalPrice field left justified.
C) This code will produce 2 columns, with the description field right justified and the totalPrice field right justified.
D) This code will produce 2 columns, with the description field left justified and the totalPrice field right justified.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions