Menu
Topics Index
...
`

My course2503


If you need explanation Read this topic

If you need Answer Take test on this topic

My course2503
What will be the output of the following program?
import java.util.*;
public class Course {
    public static void main(String[] args) {
        Formatter data = new Formatter();
        data.format(Locale.US, "course %s", "java ");
        System.out.println(data);
        data.format("tutorial %s", "Merit campus");
        System.out.println(data);
    }
}

A. course java 
tutorial Merit campus
B. course java 
course java tutorial Merit campus
C. Compilation Error
D. Runtime Error
Topic: Java Formatter Methods

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.

Ans is B since first print statement takes java as string and second statement takes Merit Capus and prints data since data has already course java it also prints

Posted by Bharath Yelchuri    2014-04-03 12:45:03


Ans is B as first string takes java and second takes merit campus and prints data as in the format

Posted by Siva Yelchuri    2014-04-03 12:57:52


Congratulations Siva Yelchuri. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-04-04 06:05:16


© meritcampus 2019

All Rights Reserved.

Open In App