Advertisement
Guest User

Java program no.1

a guest
Feb 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package myname;
  2.  
  3. import java.io.IOException;
  4.  
  5. /** První pokus
  6.  * @author hudecma1
  7.  */
  8. public class MyName
  9. {
  10.  
  11.     /** Cteni dvou stringu ze standardniho vstupu a vycisteni.
  12.      * @param args the command line arguments.
  13.      * @throws IOExpection kdyz dojde k chybe.
  14.      */
  15.     public static void main(String[] args) throws IOException {
  16.         StringBuilder sb = new StringBuilder();
  17.         char c;
  18.         while ((c = (char) System.in.read()) != '\n')
  19.         {
  20.             sb.append(c);
  21.         }
  22.         System.out.println("Nacteno: " + sb);
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement