Cast: Where Java does not allow the utilization of a source value of one type, it is essential to use a cast to force the compiler to admit the use for the target type. The care must be taken with casting values of primitive types, as this frequently comprises loss of information. Casts on object references are verified at runtime for legality. A ClassCastException exception will be unnerved for prohibited ones.