Menu
Question Index
...

What will be the output of the following program?

public class IntelMotherBoard {
    public static void main(String a[]) {
        char array[] = {'M', 'y', '_', 'J', 'a', 'v', 'a', '_', 'e', 'x', 'a', 'm', 'p', 'l', 'e'};
        String str = String.copyValueOf(array);
        System.out.print(str + ", ");
        String subStr = String.copyValueOf(array, 3, 4);
        System.out.print(subStr + ", ");
        subStr = String.copyValueOf(array, 3, 6);
        System.out.println(subStr);
        str.getChars(5, 12, array, 0);
        System.out.println(array);
    }
}


My_Java_example, Ja, J_
Myva_ex_example
My_Java_example, av, ava_
My_va_exexample
My_Java_example, Ja, Java
Ma_exam_example
My_Java_example, Java, Java_e
va_exam_example
Compilation Error or Runtime Error

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App