This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Collection " Watch "Collection " New topic
Author

Collection

Muhammad Usman
Greenhorn

Joined: Nov 18, 2001
Posts: 29
hello to all .
as we know, in collection interface we have a class vector and we usually create a vector like that
Vector v = new Vector();
which in turn returns and array v[] of capacity of 10 elements and its type is Object.
how is it possible that we are defining an simple object and in turn it is converting it into an array object.
what i understand that in vector class constructor , there will be some type of code which in turn convert v int v[].
can somebody explain me, how to do that.
i have an idiea of Vector construct like that
Vector() {
Object [] v = new Object [10];
or any use of " this" key word.
i am totally confused.
thanks in advance
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Why don't you just go LOOK? In the jdk they include a src.jar that you can open with any ZIP utility.
From the file Vector.java (minus the JavaDoc stuff that you can see in the API)

[ April 10, 2002: Message edited by: Cindy Glass ]

"JavaRanch, where the deer and the Certified play" - David O'Meara
 
 
subject: Collection