Question
What will be the output of the following Java snippet? class A { public void display() { System.out.println("Class A"); }} class B extends A { public void display() { System.out.println("Class B"); }} public class Test { public static void main(String[] args) { A obj = new B(); obj.display(); }}
More Data Structure Questions
- What will be the output of the following queue implementation using two stacks? class QueueUsingStacks { Stack s1 = new Stack <>(); Stack ...
- In the classic Tower of Hanoi puzzle, what is the minimum number of moves required to transfer a stack of 5 disks from one peg to another, following all th...
- What is the minimum number of moves required to solve the Tower of Hanoi puzzle with 10 disks?
- For Dijkstra’s algorithm on a graph with non-negative weights, which data structure yields the best time complexity for dense graphs?
- Time complexity of heap sort is:
- Artificial Intelligence Which of the following statements best describes the role of a reinforcement learning agent in a complex environment?
- Which protocol is used by devices to obtain an IP address automatically in a network?
- Convert the infix expression A + B * (C − D) to postfix notation using the standard stack-based conversion algorithm.
- Best case complexity of insertion sort is:
- What is the purpose of the keys() method in a dictionary?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)