double da = 3.3;
double db = 3.3;
double dc = 3.4;
int result = (int)da + (int)db + (int)dc; //result == 9
<number>something;
Animal animal = new Cat();
Bulldog b = (Bulldog) animal; // if (animal is Bulldog), stat.type(animal) is Bulldog, else an exception
b = animal as Bulldog; // if (animal is Bulldog), b = (Bulldog) animal, else b = null
animal = null;
b = animal as Bulldog; // b == null
b = cast(a, 'like', p)
:
double d = 3.3;
int x = (int)d;
let x = (int)(3.14)
|| x = message()
|| y = x|object| // lose type info
|| z = y|message| // regain it
Languages with Type Casting include C, TypeScript, C#, MATLAB, Chapel, C3, Jule, Speedie
View all concepts with or missing a hasExplicitTypeCasting measurement
Read more about Type Casting on the web: 1.