Ask Question

To use an ArrayList in your program, you must import:1. the java. collections package

2. the java. awt package

3. Nothing; the class is automatically available, just like regular arrays.

4. the java. util package

5. the java. lang package

+3
Answers (1)
  1. 21 August, 08:30
    0
    Option 4: the java. util package

    Explanation:

    ArrayList is one of the Java collections that offer some handy features to manipulate a list of elements. ArrayList is not available in a Java program by default without explicitly import it. To use ArrayList, we need to write an import statement as follows:

    import java. util. ArrayList;

    After that, we can only proceed to declare an ArrayList in our Java program. For example:

    ArrayList studentNames = new ArrayList ();
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “To use an ArrayList in your program, you must import:1. the java. collections package 2. the java. awt package 3. Nothing; the class is ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers