Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Format {
    public static void main(String[] args) {
        String company = "ITC";
        Formatter data = new Formatter();
        data.format("Premium %s paper", "business");
        System.out.printf("%s~", data, company);
    }
}


Premium business paper~
ITC~Premium business paper
Compilation Error
Runtime Error

Doubts

Problems

Topic: Formatting Strings And Characters By Using Formatter

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App