Menu
Question Index
...

What will be the output of the following program?

public class Coding {
    public static void main(String[] args) {
        byte name[] = {65, 108, 98, 101, 114, 116, 32, 69, 105, 110, 115, 116, 101, 105, 110};
        String decode = new String(name);
        System.out.println(decode);
        decode = new String(name, 7, name.length - 7);
        System.out.print(decode);
    }
}


65108981011141163269105110115116101105110
69105110115116101105110
Albert Einstein
Einstein
Some other output
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java String

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App