a type casting system on java