(Choose 1 answer)
Given that you have a method scale defined as follows, where scalex and scaley are int constants:
A. The compiler objects to line 1.
B. The program compiles but a runtime cast exception is thrown.
C. A compiler error occurs in line 3.
D. The program compiles and runs.
public Point scale(int x, int y ){
return new Point(
(int)(x/scalex),
(int)(y/scaley));
}
What will happen when you call this method with double primitives instead of int, as in the following fragment?
1. double px = 10.02;
2. double py = 20.34
3. Point thePoint = scale( px, py);