Given:
37. boolean b = false; 38. int i = 7; 39. double d = 1.23; 40. float f = 4.56f; 41. 42. // insert code here
Which line(s) of code, inserted independently at line 42, will compile and run without exception? (Choose all that apply.)
A, D, and E
A, D, and E have the correct conversion characters for their respective argument.
Remember that printf()
and format()
have the same functionality.
B is incorrect because integers should use %d.
C is incorrect because both floats and doubles should use %f.