Question
What is the output of the following Java code? class A { int x = 10; void show() { System.out.println("A: " +
What is the output of the following Java code? class A { int x = 10; void show() { System.out.println("A: " +
x); } } class B extends A { int x = 20; void show() { System.out.println("B: " +
x); } } public class Test { public static void main(String[] args) { A obj = new B(); System.out.println(obj.x); obj.show(); } }
More IT Operating System Questions
- If signal-to-interference ratio is 5 dB, signal power is 8 dB, then what is the interference power in dB?
- Complete the while loop condition for an iterative binary search implementation. def binary_search(arr, target): low = 0 high = len(arr) - 1 ...
- Fill in the correct option for 27 blank space.
- What is the primary goal of the Matrix Chain Multiplication problem in dynamic programming?
- State True or False Kernel level thread cannot share the code segment.
- A recursive function calculate_height(node) is designed to find the height of a binary tree (where a single node has height 0). The function is implemented...
- What is the purpose of the #define directive in programming languages like C and C++?
- Recursive algorithms, often central to Divide and Conquer, are prone to specific debugging challenges. Which of the following is a primary concern when deb...
- Which of the following statements about a B+ Tree is correct?
- What is the output of the following Java code? class A { int x = 10; void show() { System.out.println("A: " + x); } } cl...
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)