OBJECT ORIENTED PROGRAMMING THROUGH JAVA : Unit - 1 : Type Casting and Type Conversion
Type Casting It is fairly common to assign a value of one type to a variable of another type. If the two types are compatible, then Java will perform the conversion automatically. For example, it is always possible to assign an int value to a long variable. However, not all types are compatible, and thus, not all type conversions are implicitly allowed. For instance, there is no automatic conversion defined from double to byte . Fortunately, it is still possible to obtain a conversion between incompatible ...