- To Convert one data type to other data type . This process is called CASTING.
- CASTING is required when large data type is going to state in small data type.
Example -
class casting
{
public static void main(String args[])
{
long x=15l;
int y;
y= (int) x;
System.out.println(y);
}
}
Sample Output:
15
No comments:
Post a Comment