Question
The following Java code attempts to demonstrate multiple inheritance, which is not directly supported for classes in Java. How can similar functionality be achieved using interfaces? class A { Â Â void methodA() { System.out.println("Method A"); } } class B { Â Â void methodB() { System.out.println("Method B"); } } // class C extends A, B { } // Problematic: Multiple inheritance not allowed public class Main { Â Â public static void main(String[] args) { Â Â Â Â // C obj = new C(); Â Â } }
Solution
The correct answer is A
More IT Operating System Questions
- What is the range of the header of a TCP segment in bytes?
- If 1011 is transmitted with alternate-mark-inversion bipolar encoding and the corresponding transmitted voltage levels are {+1,0,-1,+1}. If the received vo...
- State True or False Kernel level thread cannot share the code segment.
- Fill in the correct option for 27 blank space.
- Binary trees are often used to represent hierarchical data. Which of the following is NOT a direct application of binary trees?
- What is the time complexity of the Floyd-Warshall algorithm for a graph with V vertices?
- Which of the following best describes a cookie in web technology?
- The ability of the device to give identical output when repeat measurement are made with the same input is defined as________
- In which of these very few non-zero values are present ?
- What is "serverless computing"?