File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes size of vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "size of vector" Watch "size of vector" New topic

size of vector

Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
what defines the size of the vector,i get two conflicting o/p by the following code,can any one tell me.
thanks for support

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41863
Why should it return 72? You're adding 216 elements to the vector.

Ping & DNS - my free Android networking tools app
Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
In total agreement with Ulf, 216 elements should be added.
[ April 08, 2008: Message edited by: Gavin Tranter ]
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

You could try to count the number of times you loop :

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: size of vector