Let’s say you want to assign the value of one data type into another variable of another data type, so there might be a case that they are not compatible with each other. To overcome this problem, we have one solution that we are going to learn today, called ‘Type Casting’ In Java, if both data types are compatible with each other, then it automatically has done its conversion, which is known as ‘Automatic type conversion.’
Typecasting is used to convert an object or variable of one type into another.
There are two types of typecasting in Java they are:
We will learn about these two types of typecasting.
#java #java type casting #type casting