Question: 1. Given the following code: int a=5; int b=2; double d=a/b; System.out.println(d); a) What is the value of d when displayed on screen? b)

1. Given the following code: int a=5; int b=2; double d=a/b; System.out.println(d); a) What is the value of d when displayed on screen? b) Why is the valued shown as an integer when d is declared as double? c) Between the double and integer datatypes, which one is larger? d) How would you rewrite the 3rd statement of the code above for getting a double value going into d? e) What is the name of the process/action which makes a datatype behave like another?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
