Again i have problem, looks form me good
package pl.codegym.task.task15.task1519;
import java.awt.geom.Arc2D;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.regex.Pattern;
/*
Różne metody dla różnych typów
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true){
String o = reader.readLine();
if (o.equals("exit")) {
print(o);
break;
}else {
if (o.matches("-*[0-9]+")){
Integer i = Integer.parseInt(o);
if (i <= 0 || i >= 128) {
print(i);
}else {
short s = Short.parseShort(o);
print(s);
}
}else if (o.matches("-*\\d+\\.\\d+")) {
Double d = Double.parseDouble(o);
print(d);
}else {
print(o);
}
}
}
}
public static void print(Double value) {
System.out.println("To jest Double. Value: " + value);
}
public static void print(String value) {
System.out.println("To jest String. Value: " + value);
}
public static void print(short value) {
System.out.println("To jest liczba całkowita typu short. Value: " + value);
}
public static void print(Integer value) {
System.out.println("To jest liczba całkowita typu Integer. Value: " + value);
}
}