πŸ“Š JAVA
Q. What will be the output of the following code
Code:
import java.util.ArrayList;
import java.util.List;
public class ListDemo {

public static void main (String args[])
{
List<Integer> list=new ArrayList<Integer>();
list.add(2);
list.add(3);
m(list);
public static void m(List<Number> list) {
System.out.println(list);
}
}

}
  • (A) 3
  • (B) 3.0
  • (C) Compile time exception
  • (D) Runtime exception
πŸ’¬ Discuss
βœ… Correct Answer: (D) Runtime exception

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
229
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Pradeep Sikarwar
Publisher
πŸ“ˆ
90%
Success Rate