Menu
Topics Index
...
`

ITC paper


If you need explanation Read this topic

If you need Answer Take test on this topic

ITC paper
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);
    }
}

A. Premium business paper~
B. ITC~Premium business paper
C. Compilation Error
D. Runtime Error
Topic: Formatting Strings And Characters By Using Formatter

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

B

Posted by Gopinath Manchikanti    2014-02-13 12:46:15


Ans:B format function will produce " Premium business paper" %s  displays ITC  " Premium business paper" will be concated

Posted by Indrasena Reddy    2014-02-13 12:49:56


No winner for this dose. Correct option is B. Indrasena Reddy was already won in this week.

Posted by Merit Campus    2014-02-14 09:22:16


© meritcampus 2019

All Rights Reserved.

Open In App