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
- Suffix Trees are useful for:
- What is the time complexity of searching an element in a balanced binary search tree (BST) with nnn nodes?
- What is the maximum number of edges possible in a simple undirected graph (no self-loops, no parallel edges) containing 7 vertices?
- What is "unit testing" and how does it relate to debugging?
- In a hash table, what is a 'collision'?
- What are the time and space complexities of the standard dynamic programming approach for finding the length of the Longest Common Subsequence (LCS) of two...
- Using Dijkstra's algorithm on a graph with edges A-B(4), A-C(1), C-B(2), B-D(1), C-D(5), what is the shortest distance from A to D?
- A connected undirected graph has 12 vertices. What is the minimum number of edges required to form a spanning tree, and how many edges would the complete g...
- Which of the following represents the Preorder Traversal of the binary tree given below? A / \ B C / \ D E
- What is the tight asymptotic time complexity of building a binary min-heap from an unsorted array of n elements using the standard bottom-up heapify approa...
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)