wood burning stoves
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 42958
Why should it return 72? You're adding 216 elements to the vector.

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: 14688

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

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link: http://aspose.com/file-tools
subject: size of vector
jQuery in Action, 3rd edition