MCQs
None.
Output:
$ javac Output.java
$ java Output
256
i.compareTo() methods two double values, if they are equal then 0 is returned and if
not equal then 1 is returned, here 257.57812 and 257.578123456789 are not equal
henc 1 is returned and stored in x.
Output:
$ javac Output.java
$ java Output
1
i.compareTo() methods two double values, if they are equal then 0 is returned and if
not equal then 1 is returned, here 257.57812 and 257.578123456789 are not equal
hence 1 is returned and stored in x.
Output:
$ javac Output.java
$ java Output
1
None.
Output:
$ javac Output.java
$ java Output
B
toString() Returns a String object representing the specified boolean. If the specified
boolean is true, then the string "true" will be returned, otherwise the string "false" will
be returned
Output:
$ javac Output.java
$ java Output
false
None.
Output:
$ javac Output.java
$ java Output
257.0
None.
Output:
$ javac Output.java
$ java Output
B
floatValue() converts the value of wrapper i into float, since float can measure till 5
places after decimal hence 257.57812 is stored in floating point variable x.
Output:
$ javac Output.java
$ java Output
257.57812
parseBoolean() Parses the string argument as a boolean. The boolean returned
floatValue() converts the value of wrapper i into float, since float can measure till 5
places after decimal hence 257.57812 is stored in floating point variable x.
Output:
$ javac Output.java
$ java Output
257.57812