6 years ago in Java File Input Output

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

[A] abc
[B] abcd
[C] abcde
[D] None of the mentioned
Loading...
Next Question

Overall Stats

Attempted 229
Correct 55
Incorrect 59
Viewed 115

Answers

Guest
Guest
chorouk chkairi
chorouk chkairi - 6 days ago

chorouk chkairi from Casablanca, Morocco is saying None of the mentioned is correct answer

atish lohade
atish lohade - 2 months ago

atish lohade from Aurangabad, India is saying abcd is correct answer

Bharath
Bharath - 2 months ago

Bharath from Hyderabad, India is saying None of the mentioned is correct answer

NOUF MOHAMMED ALGHAMDI
NOUF MOHAMMED ALGHAMDI - 3 months ago

NOUF MOHAMMED ALGHAMDI from Riyadh, Saudi Arabia is saying None of the mentioned is correct answer

ray zed
ray zed - 3 months ago

ray zed from Kanata, Canada is saying None of the mentioned is correct answer

Related Questions

Which of these is specified by a File object?

  • [A] a file in disk
  • [B] directory path
  • [C] directory in disk
  • [D] None of the mentioned