Menu
Question Index
...

What will be the output of the following program?

import java.io.*;
public class PlayingCards {
    public static void main(String args[]) throws IOException {
        byte[] king = {72, 73, 74, 75};
        ByteArrayInputStream joker = new ByteArrayInputStream(king);
        byte[] b = new byte[4];
        int num = joker.read(b, 1, 2);
        System.out.print(num + ", " + joker.read());
    }
}


1, 72
2, 74
1, H
2, J
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