While learning about implicit and explicit type casting, I tried the following code:
class Implicit
{
public static void main(String args[])
{
byte a=10;
byte b=20;
a=a+b; //
System.out.println(a);
}
}
The compiler reports:
I tried this code to see if a unary operator or any other operation in such example can cause the data type on the Right Hand Side to change.
Is this what is happening here? If so, what is the reason? What other situations would cause the data type to be altered?