79721735

Date: 2025-07-31 19:06:30
Score: 2
Natty:
Report link

The typecasting of data types works here, as we need end results in BYTE format.

The correct code is:

public class Exchange

{

public static void main(String[] args)

{

byte a = 23, b = 44;

a = (byte) (a + b);

b = (byte) (a - b);

a = (byte) (a - b);

System.out.println("a="+a, "b="+b);

}

}

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Tibude_Mansi