Menu
Question Index
...

What will be the output of the following program?

import java.util.Vector;

public class SoftwareEngineer
{
    public static void main(String args[])
    {
        Vector<String> vector = new Vector<String>();

        vector.add("Java ");
        vector.add("is ");
        vector.add("programming ");
        vector.add("language");
        System.out.println("Original vector: " + vector);

        vector.delete();
        System.out.print("Vector after deletion: " + vector);
    }
}


Original vector: [Java , is , programming , language]
Vector after deletion: [is , programming , language]
Original vector: [Java , is , programming , language]
Vector after deletion: [Java , is , programming ]
Original vector: [Java , is , programming , language]
Vector after deletion: []
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Vector

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App