Guava MCQ Questions And Answers - Java Technologies
Guava MCQs : This section focuses on "basics" of Guava. These Multiple Choice Questions (MCQ) should be practiced to improve the Guava skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Guava developed by?
A. Facebook
B. Google
C. IBM
D. Microsoft
View Answer
Ans : B
Explanation: Guava developed by Google. It facilitates best coding practices and helps reduce coding errors.
2. Guava is?
A. open source
B. java-based library
C. reliable and fast
D. All of the above
View Answer
Ans : D
Explanation: Guava is an open source, Java-based library and contains many core libraries of Google, which are being used in many of their projects. It facilitates best coding practices and helps reduce coding errors.
3. Guava provides many utility classes which are regularly required in programming application development?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Guava provides many utility classes which are regularly required in programming application development.
4. Which of the following returns an Optional instance with no contained reference?
A. abstract <T> Optional<T> absent()
B. boolean <T> Optional<T> absent()
C. static <T> Optional<T> absent()
D. abstract T get()
View Answer
Ans : C
Explanation: static <T> Optional<T> absent(): Returns an Optional instance with no contained reference.
5. Which method Ensures that index specifies a valid position in an array, list or a string of size?
A. static int checkPositionIndex(int index, int size, String desc)
B. static int checkPositionIndex(int index, int size)
C. static void checkPositionIndexes(int start, int end, int size)
D. static void checkState(boolean expression)
View Answer
Ans : B
Explanation: static int checkPositionIndex(int index, int size) : Ensures that index specifies a valid position in an array, list or a string of size.
6. abstract int compare(T left, T right) is used to?
A. Searches sortedList for key
B. Returns an arbitrary ordering
C. Compares its two arguments for order.
D. Returns an ordering which first uses the ordering
View Answer
Ans : C
Explanation: abstract int compare(T left, T right): Compares its two arguments for order.
7. Range represents?
A. interval
B. sequence
C. random
D. Both A and B
View Answer
Ans : D
Explanation: Range represents an interval or a sequence. It is used to get a set of numbers/ strings lying in a particular range.
8. Which of the following returns true if this range has a lower endpoint?
A. hashCode
B. hasLowerBound
C. hasUpperBound
D. hasBound
View Answer
Ans : B
Explanation: boolean hasLowerBound() : Returns true if this range has a lower endpoint.
9. Objects class provides helper functions applicable to all objects such as equals, hashCode, etc.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Objects class provides helper functions applicable to all objects such as equals, hashCode, etc.
10. Throwables class provides utility methods related to Throwable interface.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Throwables class provides utility methods related to Throwable interface.
Discussion