Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Discount {
    public static void main(String[] args) {
        String output;
        Formatter convert = new Formatter();
        convert.format("Quantity %o,discount %%%d ", 6, 25);
        output = convert.toString();
        System.out.println(output);
    }
}


Quantity 6,discount %25
Quantity 6,discount %25.00
Some other output
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Formatter

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App