What will be the answer for the following: 1) byte b = (byte)255; 2) byte b = (byte)128; 3) double d1=1.0; double d2=0.0; byte b=1; d1=d1/d2; b = (byte)d1; System.out.println(b); The answer for 3) is -1. How?
hi anita, in ur code u have defined byte variable b thrice(probably in the same method).could u rewrite the code so that it is clear to understand and we can help u? also what do u mean by saying The answer for 3) is -1? rajashree.