Menu
Topics Index
...
`

Software Engineer Statement


If you need explanation Read this topic

If you need Answer Take test on this topic

Software Engineer Statement
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);
    }
}

A. Original vector: [Java , is , programming , language]
Vector after deletion: [is , programming , language]
B. Original vector: [Java , is , programming , language]
Vector after deletion: [Java , is , programming ]
C. Original vector: [Java , is , programming , language]
Vector after deletion: []
D. Compilation Error
E. Runtime Error
Topic: Java Vector

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans is D,Vector class does not have delete method,to remove an element from we have to use remove method.

Posted by Raviteja Daggupati    2014-07-08 03:56:23


Congratulations Raviteja Daggupati. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-07-09 04:46:03


© meritcampus 2019

All Rights Reserved.

Open In App