Explicit type casting in java

class P_06_explicit
{
    public static void main(String[] args)
    {
        double d = 100.04;
        long l = (long)d;
        int i = (int)l;
        System.out.println("Double value "+d);
        System.out.println("Long value "+l);
        System.out.println("Int value "+i);
    }
}

Output


Comments

Popular posts from this blog

Example of Synopsis in LaTeX

Program to display the different colors using the switch statement.

Program to illustrate the concept of templates.