How to use arraylist in java netbeans?
Answer / Bhupendra Kumar Singh
To use ArrayList in NetBeans, you first need to import it. You can do this by adding the following line at the top of your Java file:
```java
import java.util.*;
After that, you can create an ArrayList object and add elements as shown below:
ArrayList<String> list = new ArrayList<String>();
list.add("Element1");
list.add("Element2");
...
```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by method?
Is 0 true or is 1 true?
When does the compiler supply a default constructor for a class?
Is char * a string?
Objects or references which of them gets garbage collected?
In how many ways we can do exception handling in java?
What is use of set in java?
What is protected and friendly?
What is the benefit of inner classes in java?
Can inner class have constructor?
What is the argument type of main() method?
How are variables stored?