Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Hackers
{
    public static void main(String args[])
    {
        int i = 225;
        List list = new ArrayList();
        list.add(new Object());
        list.add("Hackers Hacks");
        list.add(i);
        System.out.println(list.get(1));
    }
}


225
Hackers Hacks
Compilation Error
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