de.hska.java.aufgaben.kontrollstrukturen
Class Eingabe

java.lang.Object
  extended by de.hska.java.aufgaben.kontrollstrukturen.Eingabe

public class Eingabe
extends java.lang.Object

Hilfeklasse zum Einlesen von Zeichenketten und Zahlen von der Konsole.

Author:
pape

Constructor Summary
Eingabe()
           
 
Method Summary
static int parseInt(java.lang.String zahl)
          Wandelt zahl in einen int-Wert.
static double readDouble()
          Liest eine Gleitkommazahl von der Tastatur ein und gibt ihn als double-Wert zurück.
static int readInt()
          Gibt die nächste Eingabezeile als int-Wert zurück.
static java.lang.String readLine()
          Gibt die nächste Eingabezeile als String zurück.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eingabe

public Eingabe()
Method Detail

readLine

public static java.lang.String readLine()
Gibt die nächste Eingabezeile als String zurück.


readInt

public static int readInt()
Gibt die nächste Eingabezeile als int-Wert zurück. Es werden nur die ersten Ziffern inklusive Vorzeichen berücksichtigt.


parseInt

public static int parseInt(java.lang.String zahl)
Wandelt zahl in einen int-Wert.


readDouble

public static double readDouble()
Liest eine Gleitkommazahl von der Tastatur ein und gibt ihn als double-Wert zurück.



(c) Prof. Dr. Christian Pape --- Übersicht aller Java-Programmieraufgaben