MCQs
i.byteValue() method returns the value of wrapper i as a byte value. i is 257, range of byte is
256 therefore i value exceeds byte range by 1 hence 1 is returned and stored in x.
Output:
$ javac Output.java
$ java Output
1
i.intValue() method returns the value of wrapper i as a Integer. i is 257.578 is double
number when converted to an integer data type its value is 257.
Output:
$ javac Output.java
$ java Output
257
i.byteValue() method returns the value of wrapper i as a byte value. i is 257, range
valueOf() returns a Boolean instance representing the specified boolean value. If
Character.isDigit(a[0]) checks for a[0], whether it is a digit or not, since a[0] i:e 'a' is
a character false is returned. a[3] is a whitespace hence Character.isWhitespace(a[3])
returns a true. a[2] is an upper case letter i:e 'A' hence Character.isUpperCase(a[2])
returns true.
Output:
$ javac Output.java
$ java Output
false true true
Character.isDigit(a[0]) checks for a[0], whether it is a digit or not, since a[0] i:e ‘a’ is a character
false is returned. a[3] is a whitespace hence Character.isWhitespace(a[3]) returns a true. a[2] is
an upper case letter i:e ‘A’ hence Character.isUpperCase(a[2]) returns true.
Output:
$ javac Output.java
$ java Output
false true true
valueOf() returns true if the specified string contains "true" in lower or uppercase
and false otherwise.
Output:
$ javac Output.java
$ java Output
false
Character.MIN_VALUE returns the smallest character value, which is of space character ' '.
Output:
$ javac Output.java
$ java Output
i.byteValue() method returns the value of wrapper i as a byte value. i is 257, range
of byte is 256 therefore i value exceeds byte range by 1 hence 1 is returned and
stored in x.
Output:
$ javac Output.java
$ java Output
1
The super class of Byte class defines a constant MIN_VALUE below which a number