In this section you will learn
to get the capacity of a list i.e. retrieving the number of objects contained in
it. Here is an example that provides the
usage of the size() method in more detail.
Create a class "
VecSize" with a Vector. Populate
it with the integer objects using add(object) method. Now
retrieve the total number of objects contained in it using the
Here is the Code of the Example :
Here is the Output of the Example :
Posted on: February 28, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles