0

Can anyone please explain me the warnings that I am getting with this Vector Class program. Although it works, but I wanna know that what I am doing wrong.

  • Below is the source code of my program.

.

import java.util.*;
public class Vect
{
    public static void main(String args[]){
        Vector v = new Vector();
        System.out.println("Enter 5 numbers to putit in a vector");
        Scanner in = new Scanner(System.in);
        for(int i=0;i<5;i++){
            int t=in.nextInt();
            v.addElement(new Integer(t));
        }
        System.out.println("The Numbers in vector are");
        for(int i=0;i<5;i++)
            System.out.println(v.get(i));
    }
}

It give me following warnings while compiling which I'm not able to understand.

enter image description here

enter image description here

I mean whats should be the exact syntax, so that i just don't get this sort of warnings.

AbhiAbzs
  • 134
  • 2
  • 12

0 Answers0