fork download
  1. import java.io.*;
  2. class Chararrayinput {
  3. public static void main(String[] args) {
  4. String obj = "abcdef";
  5. int length = obj.length();
  6. char c[] = new char[length];
  7. obj.getChars(0,length,c,0);
  8. CharArrayReader input2 = new CharArrayReader(c, 0, 3);
  9. int i;
  10. try {
  11. while ((i = input1.read()) != -1) {
  12. System.out.print((char)i);
  13. }
  14. }
  15. catch (IOException e) {
  16.  
  17. e.printStackTrace();
  18. }
  19. }
  20. }
Success #stdin #stdout 0.09s 51212KB
stdin
Standard input is empty
stdout
abcdef