// *** III.8 Grundkonzepte der Objektorientierung (5): 
// *** Interface, v.30.11.05

import java.io.*;

interface KeyboardI {
  public int readInt ();
  public char readChar ();
  public double readDouble ();
  public String readString ();
  public boolean eof ();
}

class Keyboard implements KeyboardI{

// Author: M. Dennis Mickunas, June 9, 1997
// Primitive Keyboard input of integers, reals, strings, and characters.

static boolean iseof = false;
static char c;
static int i;
static double d;
static String s;

/* WARNING:  THE BUFFER VALUE IS SET TO 1 HERE TO OVERCOME
** A KNOWN BUG IN WIN95 (WITH JDK 1.1.3 ONWARDS)
*/
static BufferedReader input 
       = new BufferedReader (
              new InputStreamReader(System.in),1);

  public int readInt () {
    if (iseof) return 0;
    System.out.flush();
    try { 
      s = input.readLine(); 
    }
    catch (IOException e) {
      System.exit(-1);
    }
    if (s==null) {
      iseof=true; 
      return 0;
    }
    i = new Integer(s.trim()).intValue();
    return i;
  }

  public char readChar () {
    if (iseof) return (char)0;
    System.out.flush();
    try { 
      i = input.read(); 
    }
    catch (IOException e) {
      System.exit(-1);
    }
    if (i == -1) {
      iseof=true; 
      return (char)0;
    }
    return (char)i;
  }

  public double readDouble () {
    if (iseof) return 0.0;
    System.out.flush();
    try { 
      s = input.readLine();
    }
    catch (IOException e) {
      System.exit(-1);
    }
    if (s==null) {
      iseof=true; 
      return 0.0;
    }
    d = new Double(s.trim()).doubleValue();
    return d;
  }

  public String readString () {
    if (iseof) return null;
    System.out.flush();
    try { 
      s=input.readLine();
    }
    catch (IOException e) {
      System.exit(-1);
    }
    if (s==null) {
      iseof=true; 
      return null;
    }
    return s;
  }

  public boolean eof () {
    return iseof;
  }

}

public class KeyboardIApp {  
  public static void main (String argv[]) {
 
    int n = 10; 
    char ch;
    char jn;
    Keyboard kb = new Keyboard();

    System.out.print("Stack begrenzt: (j/n)");
    jn = kb.readChar();
    kb.readChar(); // skip newline
    System.out.println("Groesse des Stacks: "); 
    n = kb.readInt();
   }
}
