Computer Science
Predict the return data type in the following expressions:
int p; double q;
r = p+q;
Values & Data Types Java
7 Likes
Answer
p+q
⇒ int + double
⇒ double
So the return data type of this expression is double.
Answered By
3 Likes
Related Questions
Perform the following:
Assign the value of pie (3.142) to a variable with the requisite data type.
Perform the following:
Assign the value "TEST" to a variable with the requisite data type.
Predict the return data type in the following expressions:
float m;
p = m/3*(Math.pow(4,3));What are the resulting data types, if the following implicit conversions are performed:
int i; float f; double d; char c; byte b;
(a) i + c/b;
(b) f/d + c*f;
(c) i + f - b*c;
(d) i/c + f/b;
(e) i + f- c + b/d;