0% found this document useful (0 votes)
3 views

java vector

Vector program

Uploaded by

yashundre7767
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

java vector

Vector program

Uploaded by

yashundre7767
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Help

Run Debug Profile Team Tools Window


fault config>

Projects X Sushant.java stringbufer.java xDeepraj.java X Vectorandinheritance.jav


History

package vectorandinheritance;

import java. util. :


import java.util.Scanner;
import java.util.Vector;

public class Vectorandinheritance {

public static void main (String[ ] args)


Scanner sc=new Scanner (System. in) ;
Vector VC = new Vector (5) ;
VC. addElement (new Integer (10) ) :
VC.addElement (new Float (4. 9) ):
VC.addElement (new Character(H)):
VC.addElement (new Integer (1) ):
VC.addElement (newW Integer (100)):
VC. addElement (new Integer (8)):
VC.addElement (new Integer (190)):
System. out.println ("size of= "+VC.size()):
System. out.println ("fristelement of vector =
System. out.println ("lastelement of vector = "+VC.firstElement () )
System. out.println ("all element ="+VC): "+VC.lastElement ()):
System. out.println ("fristelement of
vector
int a -sc.nextInt () ; ="+VC.firstElement ()):
VC.
removeElement (a) :
System. outprintln ("all
System. out.println ("size of
element+VC) ;
="+VC. size ()):

You might also like