I don't understand. If it's your program you will have entered the literal yourself, so you will know what type it is. The compiler interprets liters at compile time, and impicity converts as necessary. Also there's no way to refer to a literal without some kind of variable. in whch case it's the type of the variable that define what you get, eg double x = 20;
the literal 20 is int, but x is double and the compiler will have done the conversion and discarded the original literal.