Skip to Main Content
Java
book

Java

by Michael Sikora
January 2003
Beginner to intermediate content levelBeginner to intermediate
150 pages
7h 28m
English
Morgan Kaufmann
Content preview from Java
[]
4.11 Object Wrappers
4 7
4.10 Vectors
Recall from Chapter 2 that once we create an array we cannot change its size. Vectors, on
the other hand, can grow and shrink at runtime as required. A Vector is an object of the
java.util.Vector class. A Vector object is created using the new keyword, for example,
Vector vlist = new Vector();
This creates a Vector object, vlist, with default capacity of ten elements. As soon as 10 ele-
ments have been added, the capacity, by default, will be doubled to 20 elements in total. It is
possible to specify other capacities and increment factors. To add ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Programming

Java Programming

Hari Mohan Pandey
Java Programming

Java Programming

Poornachandra Sarang
JAVA Programming

JAVA Programming

K. Rajkumar
Java 9 for Programmers

Java 9 for Programmers

Paul J. Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781558609099