Which two statements, added independently at the beginning of the program, allow the code to compile?

/* Missing statements ? */
public class ExampleList extends java.util.ArrayList {
    public static void main(String[] args) {
        java.util.ArrayList list = new java.util.ArrayList();
        list.add("Hello");
    }

    public void addElement() {
        // Missing code here
    }
}

1. No statement is required
2. import java.util.*;
3. import java.util.ArrayList;
4. import java.util.List;
5. import java.util.Collection;
Choose the correct answer from the options given below:

1
1 only
2
2 and 3
3
4 and 5
4
2 and 4
5
Question Not Attempted

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation