Advertisement
joseleonweb

Untitled

Feb 26th, 2021
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class ReadBytes {
  4.     public static void main(String[] args)
  5.     throws IOException {
  6.         byte data[] = new byte[10];
  7.        
  8.         System.out.println("Enter some characters.");
  9.         System.in.read(data);  // Read an arrat of bytes from the keyboard.
  10.         System.out.print("You entered: ");
  11.         for(int i=0; i < data.length; i++)
  12.             System.out.print((char) data[i]);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement