Forcefully conversion of one data type into another is known as type casting.
Following are the possible reasons of generating errors related to typecasting.
|<target variable>=(target data type )<source variable>;|
- Number of bytes of target variable is less than the number of bytes of source variable.
- Source and target variable are of different groups.
- boolean cannot be type cast to other data type and vice versa.
public static void main (String args[ ])
int i = 12;