Examveda

What will be the output of the following Java program?
import java.util.*;
class Output 
{
    public static void main(String args[]) 
    {
        ArrayList obj = new ArrayList();
        obj.add("A");
        obj.add(0, "B");
        System.out.println(obj.size());
    }
}

A. 0

B. 1

C. 2

D. Any Garbage Value

Answer: Option C


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Related Questions on Collections Framework in java