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 best differentiates IaaS (Infrastructure as a Service) from PaaS (Platform as a Service)?
- Which of the following is the main risk associated with Cross-Site Request Forgery (CSRF) attacks?
- In Huffman coding, data in a tree always occur?
- Which tree traversal strategy explores all the children of a node before moving on to the next level?
- Command to change the priority in LINUX
- Which of the following is the primary purpose of access control in network security?
- Purpose of Scope resolution operator
- What is the primary function of the OSI model's transport layer?
- Which numerical method is commonly used to find the roots of nonlinear equations in statistical computing?
- Which protocol among the following is responsible for the remote management of network devices?
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)