HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Java 5th Tutorial - Vector In Java

3,782 views October 31, 2016 3:00

Watch on YouTube
Channelavdhut bhise

Description from the creator

This tutorial will help you to teach the Vector class in Java. It also has different methods of Vector. Program is as follows.

import java.util.*;
class VectorDemo
{
public static void main(String []cd)
{
Vector v=new Vector();
v.addElement("Java");
v.addElement(57);
v.addElement("C");
v.addElement(5.7);
System.out.println("\nVector After Adding Element :"+v);

System.out.println("\nSize of Vector :"+v.size());
System.out.println("\nElement At 0th Location :"+v.elementAt(0));

v.removeElement(57);
System.out.println("\nVector After removing Element :"+v);

v.removeElement(5.7);
System.out.println("\nVector After removing Element :"+v);

v.removeElementAt(0);
System.out.println("\nVector After removing Element From Given Index:"+v);

v.removeAllElements();
System.out.println("\nVector After removing Element :"+v);

}
}

About this tutorial

avdhut bhise published this 3:00 video tutorial on October 31, 2016. It has been watched 3,782 times on YouTube.

Category
Education
Duration
3:00
Published
October 31, 2016
Views
3,782
Likes
27

Tags

Share

This tutorial in other languages