How to check variable type in java?

For example, the variable i given, and after calculating and casting, I want to know what data type this variable was eventually brought to.

    1 answer 1

    When you declare, you specify the type of the variable and this type remains unchanged during the execution of the program.

    For example:

     int x = 10; 

    However, you can do this:

     double y = x; 

    That is, assign the value of the variable x to the variable y with the type cast from int to type double .

    But the variable x as was of type int , remains.

    • I know this, I am interested in the operator that will return the value "int" or "float", "double" and so on - Namik21