The following program prints unexpected output, can anyone please tell me how the multicast worked here. I searched a lot and got this typecast rule "Sign extension is performed if the type of the original value is signed; zero extension if it is a char, regardless of the type to which it is being converted." Still unable to figure out the what happened while casting.
public class Multicast
{
public static void main(String[] args)
{
System.out.println((int) (char) (byte) -1);
}
}
Output: 65535