Automatic Type Casting

 package type_casting;


public class Type_Casting_narrowing {


public static void main(String[] args) {

double my_double = 2.8965;

System.out.println(my_double);


int my_int = (int)my_double;

System.out.println(my_int);

}

}


Comments

Popular posts from this blog

Type Casting

Arithmetic

Pattern 1