Hi,
Look at this mock question, can sb explain why the answer is "-1"?
/////////////////////////////////////////////
class Question {
public static void main(
String[] args) {
double d1 = 1.0;
double d2 = 0.0;
byte b =1;
d1 = d1/d2;
b = (byte) d1;
System.out.print(b);
}
}
A It results in the throwing of an ArithmeticExcepiton.
B It results in the throwing of a DivedeByZeroException.
C It displays the value 1.5.
D It displays the value �1.
//////////////////////////////////////////////
Thanks