Menu
Question Index
...

What will be the output of the following program?

public class Campus {
    public static void main(String[] args) {
        char data[]={'M','E','R','I','T',' ','C','A','M','P','U','S'};
        String output = String.valueOf(data, 3, 9);
        String str = new String(data);
        System.out.println(str);
        System.out.println(output);
    }
}


MERIT CAMPUS
MERIT CAMPUS
MERIT CAMPUS
IT CAMPUS
MERIT CAMPUS
T CAMPUS
Compilation Error
Runtime Error

Doubts

Problems

Topic: Data Conversion Using valueOf In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App