Advertisement
JoshuaStrutt

Keyboard

Feb 19th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. import java.io.*;
  2. class Keyboard{
  3.  
  4.   public static String readLine(){
  5.     try {
  6.       BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  7.       return (in.readLine());
  8.     } catch(Exception e) {
  9.       return ("");
  10.     }
  11.   }
  12.  
  13.   public static double readDouble(){
  14.     double enter = Double.parseDouble(readLine());
  15.     return (enter);
  16.   }
  17.  
  18.   public static char readChar(){
  19.     char ch =  readLine().charAt(0);
  20.     return (ch);
  21.   }
  22.  
  23.   public static void writeLine(String value){
  24.     System.out.println(value);
  25.   }
  26.  
  27.   public static void writeLine(Double value){
  28.     System.out.println(value);
  29.   }
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement