Menu
Topics Index
...
`

Arrays2072


If you need explanation Read this topic

If you need Answer Take test on this topic

Arrays2072
What will be the output of the following program?
public class TopToBottom {
    public static void main(String[] args) {
        char[] c = {'M','E','R','I','T',' ','C','A','M','P','U','S'};
        TopToBottom.Top(c);
    }
    private static void Top(char[] AssertionError) {
        System.out.println(AssertionError);
    }
}

A. (EMPTY)
B. MERIT CAMPUS
C. Some other output
D. Output can not be determined
E. Compilation Error or Runtime Error 
Topic: Creating Array Of Objects 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.

Answer is B,
We can also call methods with classname and the array elements are displayed.

Posted by Amar Kumar Biradar    2014-01-09 04:01:14


E. Compilation Error or Runtime Error....

Posted by Sagar Kamble    2014-01-09 04:06:40


ans E  compilation error  because method name should not start with capital letters

Posted by Bheema Reddy    2014-01-09 04:23:23


Answer is b becas Top is Static methd so we can call with claas name , n array elements are displayed..We cant call all methods with class we can call nly Static methods with class names\

Posted by Uday Kumar    2014-01-09 08:03:04


Congratulations Uday Kumar. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-01-10 04:17:26


© meritcampus 2019

All Rights Reserved.

Open In App