is it possible check the primitive type of a numeric value in Java 11?
Let's say I have a method
@Test
public void test1(){
short x = 10;
short y = 3;
var z = x * y // z is of int type
}
@Test
public void test1(){
short x = 10;
short y = 3;
var z = (short)x * y // z is of int type as variables are promoted
}
@Test
public void test3(){
short x = 10;
short y = 3;
var z = (short)x * (short)y // is z of primitive type short? Is there
// any way to check the type if it is short, long, int...
// I.e z instanceof ... or something similar specifically for
// primitive types?
}