Casting is a process of changing one type value to another type. In Java, we can cast one type of value to another type. It is known as type casting.
Example :
In Java, type casting is classified into two types,


Automatic Type casting take place when,
Example:
Int value 100 Long value 100 Float value 100.0
When you are assigning a larger type value to a variable of smaller type, then you need to perform explicit type casting. If we don't perform casting then compiler reports compile time error.
Example :
Double value 100.04 Long value 100 Int value 100
Here, we have one more example of explicit casting, double type is stored into long, long is stored into int etc.
Here, we are converting int and double type to byte type by using explicit type casting.