Czytaj.java

Java RMI

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Czytaj {

public static double LiczbeR (){
   double val = 0;
   String line = null;
	try {
	BufferedReader is = new BufferedReader(
		new InputStreamReader(System.in));
	  line = is.readLine();
	  val = Double.parseDouble(line);
	} catch (NumberFormatException ex) {
	  System.err.println("to nie jest liczba: " + line);
	} catch (IOException e) {
	  System.err.println("Bład: " + e);
	}
	return val;
}
public static int LiczbeC (){
int val = 0;
String line = null;
try {
	  BufferedReader is = new BufferedReader(
		new InputStreamReader(System.in));
	  line = is.readLine();
	  val = Integer.parseInt(line);
	} catch (NumberFormatException ex) {
	  System.err.println("to nie jest liczba: " + line);
	} catch (IOException e) {
	  System.err.println("Bład: " + e);
	}
	return val;
}
public static char Znak (){
String line = null;
try {
	BufferedReader is = new BufferedReader(
		new InputStreamReader(System.in));
	  line = is.readLine();
	} catch (IOException e) {
	  System.err.println("Bład: " + e);
	}
	return line.charAt(0);
}
public static String Linie (){
String line = null;
try {
	BufferedReader is = new BufferedReader(
		new InputStreamReader(System.in));
	  line = is.readLine();
	} catch (IOException e) {
	  System.err.println("Bład: " + e);
	}
	return line;
}
}

2012.11.22 22:29:13.