What would the following snippet of code produce?

import java.util.ArrayList;

public class Test {  

public static void main(String[] args) {  

 ArrayList arrList = new ArrayList(); 

arrList.add(2);   

arrList.add('2');   

arrList.add("2");   

System.out.println(arrList);  

}

}

1
[1, 1, 1]
2
[2, ‘2’, “2”]
3
[2, 2, "2"]
4
[1, 2, 3]

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation