In: Computer Science
a) Java supports Multiple Inheritance in a way that a class can inherit from multiple classes as long as they do not have the overridden methods. (T/F)
b) A class in Java cannot implement more than one interface. (T/F)
c) A class is in instance of an object (T/F)
d) In Java a class can implement multiple interfaces only if that class inherits from another base class (T/F)
e) Constructors are not inherited by the derived class (T/F)
f) Every recursive method must have a base case or a stopping condition (T/F)
g) When a class overrides a method of a superclass, the name, parameter list and the return type of the two methods do not have to be identical (T/F)
h) The running time for a binary search algorithm is O(N logN) (T/F)
i) All sorting algorithms are of order O(logN) (T/F)
a) False. Java does not support multiple inheritance as if two classes have same methods it will result in ambiguity. But even if they don't have the same methods java does not support it as this check is done during compile time and not runtime. So class cannot inherit from multiple classes as it will give compile error.
b) False. A class can implement more than one interfaces. This is because interface is just an abstract they do not have the implementation details of the methods.
c) False. A class is a concrete thing, it is the blueprint using which an object is created. So object is an instance of class.
d) False. A class can implement multiple interfaces without any conditions.as interfaces are abstract all their methods need to be defined in the class.
e) True. Constructors are special they have the same name as the class. So if a constructor is inherited by the derived class then it would violate that constraint.
f) True. The base case or stopping condition helps the recursive method to terminate. Without this the program might show unexpected behaviour
g)False. To override a method it needs to have these features- same name,same number of parameters,same type of parameters,same return type
h) False . The running time of binary search is O(logn). The maximum running time for searching an array with n elements is O(n) so the time cannot be greater than this.
i)False. Bubble, selection, insertion sort algorithms in worst case take O(n2)