Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | IT Developer <?php echo $page_title; ?>
IT Developer

Library Classes in Java

Chapter 12

Library Classes in Java

Class 10 - Logix Kips ICSE Computer Applications with BlueJ


Share with a Friend

Multiple Choice Questions


Question 1

Which of the following is a primitive data type?

  1. int
  2. float
  3. char
  4. All of these

Answer

All of these

Reason — int, float, char, all three are primitive data types in Java.

Question 2

Which of the following is a composite data type?

  1. int
  2. float
  3. char
  4. String

Answer

String

Reason — String is a composite data type.

Question 3

The return type of the isLowerCase() method is ............... .

  1. int
  2. boolean
  3. char
  4. String

Answer

boolean

Reason — The return type of isLowerCase() method is boolean as it returns true if the character argument is in lower case else it returns false.

Question 4

The return type of the toLowerCase() method is ............... .

  1. int
  2. boolean
  3. char
  4. String

Answer

char

Reason — The return type of the toLowerCase() method is char as it converts the given character argument into lower case.

Question 5

The value returned by Integer.parseInt("-321") is ............... .

  1. -321
  2. 321
  3. 321.0
  4. "321"

Answer

-321

Reason — parseInt() converts the given String argument into an integer value if the given string is a combination of numbers and decimal. The String can have a '-' sign in the beginning.

Question 6

Name the method that can convert a string into its integer equivalent.

  1. Integer.parseInteger()
  2. Integer.getInt()
  3. Integer.parseInt()
  4. Integer.readInt()

Answer

Integer.parseInt()

Reason — Integer.parseInt() method parses the String argument as a signed integer.

Question 7

What will be the result when the following statement is executed?
int count = new Integer(12);

  1. Variable count will be initialised with value 12.
  2. Variable count will be initialised with default value of int, i.e., zero (0).
  3. An array count will be initialised with 12 elements, all having a default value of zero (0).
  4. Value of count will be unknown as no value has been assigned yet.

Answer

Variable count will be initialised with value 12.

Reason — The given statement initialises the variable count with the integer value 12.

Question 8

In which package is the wrapper class Integer available?

  1. java.io
  2. java.util
  3. java.awt
  4. java.lang

Answer

java.lang

Reason — All the wrapper classes are available in java.lang package.