Your SlideShare is downloading. ×
  • Like
Function Java Vector class
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Function Java Vector class

  • 92 views
Published

Vector class

Vector class

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
92
On SlideShare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Vector Class Vector Vector [] ( Vector java.util Vector Comparable Vector Collections.sort() Collections java.util
  • 2. 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
  • 3. Vector Class Reference:: Java::Vector Class setElementAt() vector removeElementAt() vector removeElement() vector removeAllElements() vector firstElement() element lastElement() element vector get() element vector
  • 4. Vector Class Reference:: Java::Vector Class elementAt() element vector remove() element vector clear() vector capacity() vector size() vector isEmpty() indexOf() vector vector
  • 5. Vector Class Back Reference :: Java :: Vector Class :: new Vector() Method new Vector (); return type Vector Content object vector example Vector vector = new Vector ();
  • 6. Vector Class Back
  • 7. 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 );
  • 8. Vector Class Back
  • 9. 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 );
  • 10. Vector Class Back
  • 11. 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 );
  • 12. Vector Class Back
  • 13. 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" );
  • 14. Vector Class Back
  • 15. 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" );
  • 16. Vector Class Back
  • 17. 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 );
  • 18. Vector Class Back
  • 19. 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 );
  • 20. Vector Class Back
  • 21. 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 );
  • 22. Vector Class Back
  • 23. 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" );
  • 24. Vector Class Back
  • 25. 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 ();
  • 26. Vector Class Back
  • 27. 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 ();
  • 28. Vector Class Back
  • 29. 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();
  • 30. Vector Class Back
  • 31. 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 );
  • 32. 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 );
  • 33. Vector Class Back
  • 34. 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 );
  • 35. Vector Class Back
  • 36. 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 );
  • 37. Vector Class Back
  • 38. 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 ();
  • 39. Vector Class Back
  • 40. 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 ();
  • 41. Vector Class Back
  • 42. 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 ();
  • 43. Vector Class Back
  • 44. 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" ); }
  • 45. Vector Class Back
  • 46. 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" );
  • 47. Vector Class Back