Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- It returns "4.0" because the int 4 is converted to a double
- It returns "12" beacuse the int returned is generated by the function f with parameters Double and Long
- 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
- It returns "11" Because the function f that accepts an int returns 11 and the Literal is converted to a float upon passing
- It returns "6.0" because the int 6 that is passed into the constructor of b2 is converted to a float
- 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
- 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
- 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.
- 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
- 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