SlideShare a Scribd company logo
1 of 47
Vector
Class
Vector

Vector
[]
(
Vector

java.util

Vector
Comparable
Vector
Collections.sort()
Collections
java.util
Vector
Class
Reference:: Java::Vector Class
new Vector()

object vector

new Vector( int_length )

object vector

new Vector( length, size_increment )

object vector

setSize()

vector

addElement()

vector

add()

vector
Vector
Class
Reference:: Java::Vector Class
setElementAt()
vector
removeElementAt()
vector
removeElement()

vector

removeAllElements()

vector

firstElement()

element

lastElement()

element

vector
get()

element

vector
Vector
Class
Reference:: Java::Vector Class
elementAt()

element
vector

remove()

element
vector

clear()

vector

capacity()
vector
size()

vector
isEmpty()
indexOf()

vector
vector
Vector
Class

Back

Reference :: Java :: Vector Class :: new Vector()
Method

new Vector ();

return type

Vector

Content

object vector

example

Vector vector = new Vector ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: new Vector( int_length )
Method

new Vector ( length );

return type

Vector

Content
example

object vector
Vector vector = new Vector ( 20 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class ::new Vector( length,size_increment)
Method

new Vector ( length, size_increment );

return type

Vector

Content

example

object vector

Vector vector = new Vector ( 20, 10 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class ::setSize()
Method

setSize ( length );

return type

void

Content
example

vector
Vector vector = new Vector ( 20, 10 );
vector.setSize ( 30 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: addElement()
Method

addElement ( object_string );

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "labcode" );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: add()
Method

add ( index, object_string );

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "labcode" );
vector.add ( 0, "bamboo" );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: insertElementAt()
Method

insertElementAt ( object_string, index );

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "labcode" );
vector.insertElementAt ( "bamboo", 0 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: setElementAt()
Method

setElementAt ( object_string, index );

return type

void

Content

vector
example

Vector vector = new Vector ();
vector.addElement ( "bambooss" );
vector.addElement ( "labcode" );
vector.setElementAt ( "bamboo", 0 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: removeElementAt()
Method

removeElementAt ( index );

return type

void

Content

vector
example

Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
vector.removeElementAt ( 1 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: removeElement()
Method

removeElement ( object_string );

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
vector.removeElement ( "lab" );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: removeAllElements ()
Method

removeAllElements ();

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
vector.removeAllElements ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: firstElement()
Method

firstElement ();

return type

Object

Content
example

element

vector

Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" ); String str =
( String ) vector.firstElement ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: lastElement()
Method

lastElement ();

return type

Object

Content
example

element

vector

Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
String str = ( String ) vector.lastElement();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: get()
Method

get ( index );

return type

Object

Content
example

element
vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
String str = ( String ) vector.get ( 1 );
Vector
Class

Back

Reference :: Java :: Vector Class :: get()
Method

get ( index );

return type

Object

Content
example

element
vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
String str = ( String ) vector.get ( 1 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: elementAt()
Method

elementAt ( index );

return type

Object

Content
example

element
vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
String str = ( String )
vector.elementAt ( 1 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: remove()
Method

remove ( index );

return type

Object

Content

element

vector
example

Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
String str = ( String ) vector.remove ( 1 );
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: clear()
Method

clear ();

return type

void

Content
example

vector
Vector vector = new Vector ();
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
vector.clear ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: capacity()
Method

capacity()

return type

int

Content

vector
example

Vector vector = new Vector ( 20 );
int num_size = vector.capacity ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: size()
Method

size ();

return type

int

Content

vector
example

Vector vector = new Vector ( 20 );
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
int num_size = vector.size ();
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: isEmpty()
Method

isEmpty ();

return type

boolean

Content

vector

example

Vector vector = new Vector ( 20 );
if ( vector.isEmpty () )
{
System.out.println ( "vector empty" );
}
Vector
Class

Back
Vector
Class

Back

Reference :: Java :: Vector Class :: indexOf()
Method

indexOf ( object_string );

return type

int

Content

example

vector

Vector vector = new Vector ( 20 );
vector.addElement ( "bamboo" );
vector.addElement ( "lab" );
vector.addElement ( "code" );
int index_find =
vector.indexOf("bamboo" );
Vector
Class

Back

More Related Content

What's hot

String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)
Ravi Kant Sahu
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
kamal kotecha
 

What's hot (20)

Wrapper class (130240116056)
Wrapper class (130240116056)Wrapper class (130240116056)
Wrapper class (130240116056)
 
Wrapper classes
Wrapper classes Wrapper classes
Wrapper classes
 
Autoboxing And Unboxing In Java
Autoboxing And Unboxing In JavaAutoboxing And Unboxing In Java
Autoboxing And Unboxing In Java
 
Java String
Java String Java String
Java String
 
Built in classes in java
Built in classes in javaBuilt in classes in java
Built in classes in java
 
wrapper classes
wrapper classeswrapper classes
wrapper classes
 
String handling(string buffer class)
String handling(string buffer class)String handling(string buffer class)
String handling(string buffer class)
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Generics
GenericsGenerics
Generics
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
OOPs & Inheritance Notes
OOPs & Inheritance NotesOOPs & Inheritance Notes
OOPs & Inheritance Notes
 
James Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on PythonJames Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on Python
 
Wrapper classes
Wrapper classesWrapper classes
Wrapper classes
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
 
Collections and generic class
Collections and generic classCollections and generic class
Collections and generic class
 
Java tutorial part 3
Java tutorial part 3Java tutorial part 3
Java tutorial part 3
 
Cats in Scala
Cats in ScalaCats in Scala
Cats in Scala
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
 
Collections
CollectionsCollections
Collections
 

Similar to Function Java Vector class

Inheritance And Traits
Inheritance And TraitsInheritance And Traits
Inheritance And Traits
Piyush Mishra
 
This assignment uses a rubric of 200 points It focuses on O.pdf
This assignment uses a rubric of 200 points It focuses on O.pdfThis assignment uses a rubric of 200 points It focuses on O.pdf
This assignment uses a rubric of 200 points It focuses on O.pdf
adislifestyle
 

Similar to Function Java Vector class (20)

Vector3
Vector3Vector3
Vector3
 
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
 
Java.util
Java.utilJava.util
Java.util
 
Java collections
Java collectionsJava collections
Java collections
 
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...
 
javacollections.pdf
javacollections.pdfjavacollections.pdf
javacollections.pdf
 
Array properties
Array propertiesArray properties
Array properties
 
Inheritance And Traits
Inheritance And TraitsInheritance And Traits
Inheritance And Traits
 
Presentation1
Presentation1Presentation1
Presentation1
 
This assignment uses a rubric of 200 points It focuses on O.pdf
This assignment uses a rubric of 200 points It focuses on O.pdfThis assignment uses a rubric of 200 points It focuses on O.pdf
This assignment uses a rubric of 200 points It focuses on O.pdf
 
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptxvectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
 
20 ch22 collections
20 ch22 collections20 ch22 collections
20 ch22 collections
 
Java Reflection
Java ReflectionJava Reflection
Java Reflection
 
STRINGS IN JAVA
STRINGS IN JAVASTRINGS IN JAVA
STRINGS IN JAVA
 
Lecture 4_Java Method-constructor_imp_keywords
Lecture   4_Java Method-constructor_imp_keywordsLecture   4_Java Method-constructor_imp_keywords
Lecture 4_Java Method-constructor_imp_keywords
 
Module 7 : Arrays
Module 7 : ArraysModule 7 : Arrays
Module 7 : Arrays
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
 
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
 
Introduction to Python - Part Three
Introduction to Python - Part ThreeIntroduction to Python - Part Three
Introduction to Python - Part Three
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

Function Java Vector class