A good answer might be:
Point A = new Point(); short a = 93, b = 92; int i = 12, j = 13; long x = 0, y = 44; double u = 13.45, v = 99.2; A.move( i, b ); // OK --- b can be converted to int without loss A.move( a, x ); // NOT OK --- converting x to int may lose magnitude and precision A.move( u, b ); // NOT OK --- converting u to int may lose magnitude and precision | |
Method using a double ParameterThe cos() method is a static method of the Math class. (Remember that a static method is a method that belongs to the definition of the class; you do not need an object to use it.) Here is how the method looks in the documentation for the Math class: The method requires a parameter of type double. It evaluates to (returns) a double, the cosine of the parameter. The parameter is in radians (not degrees.) Here is it being used in a program:public static double cos( double num )
| |
QUESTION 9:Is the parameter in the method call the correct type? Click Here after you have answered the question |