This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Collection

 
Muhammad Usman
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic