hi,
I have been solving mock exams on javabeat site and facing with the understanding part.Here is one ,
What happens when the following code gets executed:
class TechnoSample {
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);
}}
(1) It results in the throwing of an ArithmeticExcepiton
(2) It results in the throwing of a DivedeByZeroException
(3) It displays the value 1.5
(4) It displays the value ���1
answer is 1.Explain?
thankyou