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
- What is the primary purpose of design patterns in software engineering?
- In Hadoop’s distributed storage system, which of the following is responsible for managing and storing the actual data blocks?
- Bitwise operators in C++
- Which of the following is an example of application software?
- Which of the following sorting algorithms is NOT stable?
- In which scenario would para virtualization be preferred over full virtualization?
- What is the primary purpose of Dynamic Host Configuration Protocol (DHCP) in networking?
- State true or false Confidentiality, integrity and availability, also known as the CIA triad, is a model designed to guide policies for information securi...
- What type of firewall inspects packets and determines whether they are allowed based on pre-established rules?
- Who is widely regarded as the "Father of the Computer" for his conceptual design of the Analytical Engine?
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)