ICSE Class 10th Board Exams
20 MCQ questions on Java library methods return types
1. What is the return type of the "charAt()" method in the "String" class?
a. int
b. char
c. String
d. boolean
2. In the "Math" class, what is the return type of the "sqrt()" method?
a. int
b. double
c. float
d. long
3. What does the "length()" method in the "String" class return?
a. int
b. double
c. boolean
d. String
4. In the "ArrayList" class, what is the return type of the "add()" method?
a. void
b. int
c. boolean
d. String
5. What is the return type of the "toUpperCase()" method in the "String" class?
a. char
b. String
c. int
d. boolean
6. In the "Scanner" class, what is the return type of the "nextInt()" method?
a. int
b. String
c. double
d. boolean
7. What does the "indexOf()" method in the "String" class return?
a. int
b. char
c. boolean
d. String
8. In the "Arrays" class, what is the return type of the "sort()" method?
a. void
b. int
c. boolean
d. String
9. What is the return type of the "charAt()" method in the "StringBuilder" class?
a. int
b. char
c. String
d. boolean
10. In the "File" class, what is the return type of the "exists()" method?
a. boolean
b. int
c. String
d. void
11. What does the "toLowerCase()" method in the "String" class return?
a. char
b. String
c. int
d. boolean
12. In the "ArrayList" class, what is the return type of the "remove()" method?
a. void
b. int
c. boolean
d. String
13. What is the return type of the "nextLine()" method in the "Scanner" class?
a. String
b. int
c. double
d. boolean
14. In the "Character" class, what is the return type of the "isDigit()" method?
a. char
b. String
c. int
d. boolean
15. What does the "length()" method in the "StringBuilder" class return?
a. int
b. char
c. Stringd. boolean
16. In the "Arrays" class, what is the return type of the "binarySearch()" method?
a. int
b. void
c. boolean
d. String
17. What is the return type of the "equals()" method in the "String" class?
a. int
b. char
c. boolean
d. String
18. In the "File" class, what is the return type of the "length()" method?
a. int
b. boolean
c. String
d. void
19. What does the "substring()" method in the "String" class return?
a. char
b. String
c. int
d. boolean
20. In the "ArrayList" class, what is the return type of the "get()" method?
a. void
b. int
c. Object
d. boolean
1. b, 2. b, 3. a, 4. a, 5. b, 6. a, 7. a, 8. a, 9. b, 10. a, 11. b, 12. a, 13. a, 14. d, 15. a, 16. a, 17. c, 18. a, 19. b, 20. c
Comments
Post a Comment