-
What is the output of this program?
import java.io.*;
public class filesinputoutput_Example
{
public static void main(String[] args)
{
String object = "interview mania";
byte p[] = object.getBytes();
ByteArrayInputStream object1 = new ByteArrayInputStream(p);
for (int K = 0; K < 2; ++K)
{
int q;
while ((q = object1.read()) != -1)
{
if (K == 0)
{
System.out.print(Character.toUpperCase((char)q));
}
}
}
}
}
-
- interview mania
- MANIA
- INTERVIEW
- INTERVIEW MANIA
- None of these
Correct Option: D
INTERVIEW MANIA