Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. It returns "4.0" because the int 4 is converted to a double
  2. It returns "12" beacuse the int returned is generated by the function f with parameters Double and Long
  3. It returns "13" because the function f is defined as an Integer that returns 13 in the case that the parammeters double and int are passed
  4. It returns "11" Because the function f that accepts an int returns 11 and the Literal is converted to a float upon passing
  5. It returns "6.0" because the int 6 that is passed into the constructor of b2 is converted to a float
  6. It returns "13" because the fucntion f that accepts a floating-point Literal (double/float) and an int, in this case within it's Object Wrapper "integer" returns 13
  7. It returns 1.5 because the second constructor, whose paramaters match those of b3 state that the classes double d should equal the third parameter given which is a double, in this case valued at 1.5
  8. This returns 8.0 as it is a float literal of 8, as seen by the 'f' following the 8 in the definition of the function g that accepts a double, and a double is the default floating-point native type in Java.
  9. This returns 7.0 as the function g that accepts a Float as a parameter is set to return a double valued at 7.0
  10. This returns 13 as the function g that is called upon 19f defaults to a double rather than a Float wrapper, this returns 8f, into the function f which accepts a double and int as parameters, as the default type of a floating point value is a double in java, and so the Integer 13 is returned
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement