5) What will be the output of the following program?
package console; public class Ques02 { public static void main(String[] args) { int anInt = 100; double aDouble = 100.00; System.console().format("%2d - %1f", anInt, aDouble); } }
- The program will output ‘100.000000 – 100’.
- The program will output ‘100 – 100.000000’.
- The program will throw a IllegalFormatConversionException at run-time.
- The program will output ‘100 – 100’.
Answer
5) b.