Question
What will be the output of the following code snippet demonstrating composition in Java? class Engine { void start() { System.out.println("Engine started."); }} class Car { private Engine engine; Car() { engine = new Engine(); // Composition } void start() { engine.start(); }} public class Test { public static void main(String[] args) { Car car = new Car(); car.start(); }}
More Basics of Computers Questions
- Which of the following is an example of Polymorphism in Object-Oriented Programming?
- What is the purpose of the with statement when working with files?
- What is the primary purpose of Regression Testing?
- Which of the following page replacement algorithms might lead to Belady’s anomaly, where increasing the number of page frames increases the number of page ...
- In the context of virtualization, paravirtualization differs from full virtualization in which of the following ways?
- Which search strategy guarantees the optimal solution?
- What is the primary purpose of design patterns in software engineering?
- Predict the correct output of below code in python Greeting = lambda : print('Welcome to Ixambee’) Greeting()
- In the field of Natural Language Processing (NLP), which of the following tasks focuses on identifying the sentiment behind a given text? ...
- Which of the following statements about Constructors in Object-Oriented Programming is correct?
Relevant for Exams:
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)