Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class SoftwareProgrammer {
    public static void main(String[] args) {
        Enumeration seasons;
        Vector v = new Vector<>();
        v.add("Winter");
        v.add("Spring");
        v.add("Rainy");
        seasons = v.elements();
        v.add("Summer");
        while (seasons.hasMoreElements()) {
            System.out.print(seasons.nextElement() + ", ");
        }
    }
}


Winter, Spring, Rainy,
Rainy, Spring, Summer, Winter,
Winter, Spring, Rainy, Summer,
Winter, Summer, Spring, Rainy,
Some other output
Compilation Error or 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