In this section you will learn to
retrieve an ArrayList object (that contains multiple elements) using the
get() method. Here is an example that provides the
usage of the get() method in more detail.
Create a class "Get" with an ArrayList .Populate
it with the integer objects. Now retrieve an object( that
is contained in the arraylist) using the get() method.
Here is the Code of the Example :
Get.java:
import java.util.*;
|
Here is the Output of the Example :
| C:\roseindia>javac get.java C:\roseindia>java get 3 |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: To Retrieve a Particular Object From an ArrayList View All Comments
Post your Comment