Menu
Question Index
...

What will be the output of the following program?

import java.io.*;
public class USingSkip {
    public static void main(String args[]) throws IOException {
        byte[] b = {25, 35, 45, 55};
        ByteArrayInputStream array = new ByteArrayInputStream(b);
        int m = 0;
        while ((m = array.read()) != -1) {
            array.skip(2);
            System.out.println(m);
        }
    }
}


25
45
25
35
25
55
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java ByteArrayInputStream

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App