Question
.Consider the following Java code: class Shape { void draw() { System.out.println("Drawing a generic shape"); } } class Circle extends Shape { @Override void draw() { System.out.println("Drawing a circle"); } } class Rectangle extends Shape { @Override void draw() { System.out.println("Drawing a rectangle"); } } public class TestPolymorphism { public static void main(String[] args) { Shape s1 = new Circle(); Shape s2 = new Rectangle(); Shape s3 = new Shape(); s1.draw(); s2.draw(); s3.draw(); } } What will be the output of this code?
More IT Operating System Questions
- A file of size 4 MB needs to be transmitted over a link with a bandwidth of 2 Mbps. Ignoring propagation delay and protocol overhead, what is the transmiss...
- Complete the Python function to return the number of elements in a given list. def get_list_length(my_list): _________ # Line to complete
- What does the Hamming distance between two binary strings represent?
- Which of the following is true for an anonymous function in Java?
- SLA stands for :
- What is the primary concept behind the ALOHA protocol in network communication?
- Fill the blank In K-Means algorithm, we calculate the distance between each point of the dataset to every ________ initialized.
- Using Dijkstra's algorithm with a min-heap (binary heap) implementation on a graph with V vertices and E edges, what is the overall time complexity?
- Which of the following statements about a decoder is correct?
- Which IPv6 feature can unintentionally expose internal network structure to attackers if not properly randomized?
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)