At runtime, in my Java program, given a String, I 'd like to know the return type. For example:
1 + 1
returnsint
1L + 1L
returnslong
1L + 1
returnslong
1 + 1.5
returnsdouble
1 + 2 - 3 * 4 / 5
returnsint
1 / 0
returnsint
1 + Math.nextInt()
returnsint
1.5 + Math.nextInt()
returnsdouble
How can I do this with the JDK runtime compiler, ECJ or any other dependency?
Aucun commentaire:
Enregistrer un commentaire