Menu
Question Index
...

What will be the output of the following program?

import java.io.*;
public class Scientist extends PrintStream {
    public Scientist(OutputStream out) {
        super(out);
    }
    public static void main(String[] args) {
        byte kalam[] = {97, 98, 99, 100};
        Scientist ps = new Scientist(System.out);
        ps.write(kalam, 1, 3);
    }
}


979899
9899100
abc
bcd
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java PrintStream Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App