Menu
Question Index
...

What will be the output of the following program?

import java.io.*;
public class Reader {
    public static void main(String args[]) {
        StringReader r = new StringReader("All is well");
        for (int i = 0; i < 6; i++) {
            char ch = (char) r.read();
            System.out.print(ch + "");
        }
        r.close();
    }
}


(EMPTY)
All is
Compilation Error
Runtime Error

Doubts

Problems

Topic: Reader Class 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