Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.NumberFormat;
import java.util.Locale;

public class Main {
    public static void main(String[] argv) throws Exception {

        Number number = NumberFormat.getNumberInstance(Locale.GERMAN).parse("-1.234,56");
        if (number instanceof Long) {
            System.out.println("Long value");
        } else {
            System.out.println("Double value");
        }
    }
}