Menu
Question Index
...

What will be the output of the following program?

public class Copy {
    public static void main(String[] args) {
        int input[] = {23, 26, 52, 36, 75};
        byte copy[] = new byte[6];
        System.arraycopy(input, 0, copy, 0, input.length);
        for (byte element : copy) {
            System.out.print(element + " ");
        }
    }
}


23 26 52 36 75 0
23 26 52 36 75
Compilation Error
Runtime Error

Doubts

Problems

Topic: System Class arraycopy() Method 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