Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Scale {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add(10);
        list.add(12);
        list.add(13);
        list.add(14);
        list.add(15);
        ListIterator it1 = list.listIterator();
        while (it1.hasPrevious())
            System.out.println(it1.previous() + ",");
    }
}


15,14,13,12,10,
10,12,13,14,15,
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: List Iterator In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App