Please do all the multiple choice question without any explanation, just give me
ID: 3583027 • Letter: P
Question
Please do all the multiple choice question without any explanation, just give me the right choice
1- What is the main benefit of inheritance?
a)It allows you to reuse software that has already been designed, implemented, and tested.
b)It allows you to create parent classes from child concrete classes.
c)It allows you to expose existing private variables and methods as public services.
d)It allows you to create parent classes from child interfaces and abstract classes.
2- When you have a sorted list, what is the best method to use for searching:
a) linear search algorithm
b)simple for loop
c)simple for each loop
d)binary search algorithm
3-In Java SE 8, each of the following is true about the TreeMap class (https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html), EXCEPT;
a) It is a subclass of AbstractMap
b) It implements NavigableMap (whether directly or indirectly)
c)It implements SortableMap (whether directly or indirectly)
d) It extends HashMap (whether directly or indirectly)
a)It allows you to reuse software that has already been designed, implemented, and tested.
b)It allows you to create parent classes from child concrete classes.
c)It allows you to expose existing private variables and methods as public services.
d)It allows you to create parent classes from child interfaces and abstract classes.
Explanation / Answer
Answer1:
b)It allows you to create parent classes from child concrete classes.
Answer2:
d)binary search algorithm
Answer3:
d) It extends HashMap (whether directly or indirectly)