Question 772: Which of the following would compile without error?
tcs
wipro
infosys
general
aptitude
javalang-class
java-programming
The return value of theMath.abs()method is always the same as the type of the parameter passed into that method.In the case ofA, an integer is passed in and so the result is also an integer which is fine for assignment to "int a".The values used in B, C & D respectively are adouble, a float and a long. The compiler will complain about a possible loss of precision if we try to assign the results to an "int".