Wednesday, February 25, 2009

example code implicitcasting

Compiler is responsible for implicit type casting Before see the example see this diagram it is very easy to understand.

All possible implicit type casting






public class ImplicitCast {
public static void main (String ar[]){
int i=10;
float f=i;
System.out.println(f); //10.0

char ch='a';
int j=ch;
System. out.println(j); //97

}
}


0 comments:

Post a Comment