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
- In Unix, a file has permissions rwxr-x---. Which command changes its permissions to rw-r-----?
- Complete the insert_at_beginning function for a singly linked list. Assume Node has data and next attributes. class Node: def __init__(self, data):...
- In a bank's IT governance framework, which statement correctly describes the relationship between a Business Continuity Plan (BCP) and a Disaster Recovery ...
- A DP solution for LCS is producing incorrect lengths. Upon inspection, the dp table is being filled, but the values don't match expected outcomes. Which of...
- A data analysis task involves evaluating an arithmetic expression represented as a binary tree. Which traversal method is most suitable for generating a po...
- Which Hadoop component is responsible for resource management?
- Maximum Power transfer occurs when the_____
- Which concept is demonstrated when multiple methods in the same class have the same name but different parameters?
- Consider the following C code: #include #include int main() { char* text = "The quick brown fox jumps over the lazy dog."; char* pattern...
- Which is best fit for blank space 17?
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)