Menu
Topics Index
...
`

Computer Equipment Manufacturers


If you need explanation Read this topic

If you need Answer Take test on this topic

Computer Equipment Manufacturers
What will be the output of the following program?
public class Manufacturers {
    public static void main(String[] args) {
        String desktopComputer[] = {"Acer", "Apple", "Dell", "IBM", "Samsung"};
        String noteBooks[] = {"KOBO", "Google", "ViewSonic", "Microsoft"};
        System.arraycopy(desktopComputer, 1, noteBooks, 0, noteBooks.length);
        for (String element : noteBooks) {
            System.out.print(element + " ");
        }
    }
}

A. Acer Apple Dell IBM
B. Acer Apple ViewSonic Microsoft
C. Apple Dell IBM Samsung
D. Compilation Error
E. Runtime Error
Topic: System Class arraycopy() Method In Java

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 must be C as the desktopComputer array gets copied from pos 1 to noteBooks array..as notebooks.length=4 elements are copied..ans must be C

Posted by Pramod Jain    2014-04-03 03:53:18


ans is c.desktop computer array is copied to notebooks starting from index 1

Posted by Chintu Raparthi    2014-04-03 06:55:50


Ans is c desktopcomputers array consists of 5 values index of 0 to 4 and in for condition it is printed upto notebookcomputer length

Posted by Bharath Yelchuri    2014-04-03 07:00:34


Congratulations Pramod Jain. 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:06:39


© meritcampus 2019

All Rights Reserved.

Open In App