Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javagently;
- import java.io.*;
- public class LasIn{
- private static BufferedReader l�sin=
- new BufferedReader(
- new InputStreamReader(System.in));
- public static int l�sHeltal(String p){
- try{
- System.out.print(p);
- String indata=l�sin.readLine();
- int k=Integer.parseInt(indata);
- return k;
- }
- catch(Exception e){
- throw new RuntimeException(
- "l�sHeltal:ej ett heltal");
- }
- }
- public static double l�sFlyttal(String p){
- try{
- System.out.print(p);
- String indata=l�sin.readLine();
- double k=Double.valueOf(indata).doubleValue();
- return k;
- }
- catch(Exception e){
- throw new RuntimeException(
- "l�sFlyttal:ej ett flyttal");
- }
- }
- public static String l�sStr�ng(String p){
- try{
- System.out.print(p);
- String indata=l�sin.readLine();
- return indata;
- }
- catch(Exception e){
- throw new RuntimeException(
- "l�sStr�ng:ej en str�ng");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement