1.

What is the output of this program?import java.io.*; public class Chararrayinput_Example { public static void main(String[] args) { String object = "pqrst"; int length = object.length(); char p[] = new char[length]; object.getChars(0, length, p, 0); CharArrayReader input1 = new CharArrayReader(p); CharArrayReader input2 = new CharArrayReader(p, 1, 4); int K; int L; try { while ((K = input1.read()) == (L = input2.read())) { System.out.print((char)K); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }

A. pqrst
B. pqr
C. rst
D. pqrs
E. None of these
Answer» F.


Discussion

No Comment Found

Related MCQs