0%
0 / 15 answered
Casting and Range of Variables Practice Test
•15 QuestionsQuestion
1 / 15
Q1
A physics renderer stores pixels in a short:
class MotionRenderer {
public static short packPixels(int pixels) {
return (short) pixels; // narrowing conversion
}
}
Considering the given scenario, what error will occur if the value of pixels exceeds its type range?
A physics renderer stores pixels in a short:
class MotionRenderer {
public static short packPixels(int pixels) {
return (short) pixels; // narrowing conversion
}
}
Considering the given scenario, what error will occur if the value of pixels exceeds its type range?