- Home
- Chapter 1 - Object Oriented Programming Concepts
- Object Oriented Programming Concepts
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 2 - Introduction to Java
- Introduction to Java
- Multiple Choice Questions
- Assignment Questions
- Chapter 3 - Values and Data Types
- Values and Data Types
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 4 - Operators in Java
- Operators in Java
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 5 - User-Defined Methods
- User-Defined Methods
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 6 - Input in Java
- Input in Java
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 7 - Mathematical Library Methods
- Mathematical Library Methods
- Multiple Choice Questions
- Assignment Questions
- Chapter 8 - Conditional Constructs in Java
- Conditional Constructs in Java
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 9 - Iterative Constructs in Java
- Iterative Constructs in Java
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions and Programs
- Chapter 10 - Nested for loops
- Nested for loops
- Assignment Questions and Programs
- Chapter 11 - Constructors
- Constructors
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 12 - Library Classes
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 13 - Encapsulation and Inheritance
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 14 - Arrays
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 15 - String Handling
- Library Classes
- Multiple Choice Questions
- Assignment Questions
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?
- int
- float
- char
- 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?
- int
- float
- char
- String
Answer
String
Reason — String is a composite data type.
Question 3
The return type of the isLowerCase() method is ............... .
- int
- boolean
- char
- 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 ............... .
- int
- boolean
- char
- 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 ............... .
- -321
- 321
- 321.0
- "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.
- Integer.parseInteger()
- Integer.getInt()
- Integer.parseInt()
- 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);
- Variable count will be initialised with value 12.
- Variable count will be initialised with default value of int, i.e., zero (0).
- An array count will be initialised with 12 elements, all having a default value of zero (0).
- 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?
- java.io
- java.util
- java.awt
- java.lang
Answer
java.lang
Reason — All the wrapper classes are available in java.lang package.
