Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class PrintList {
    public static void main(String args[]) {
        int i = 132;
        List list = new ArrayList();
        list.add(new Object());
        list.add("Hey! How are you?");
        list.add(i);
        System.out.println(list.get(1));
    }
}


132
Hey! How are you?
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java ArrayList

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App