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 statements best describes a key difference between virtual machines and containers?
- Which of the following data structures is best suited for implementing a breadth-first search (BFS) traversal on a graph?
- Which cloud service model provides an environment for developers to build applications without managing the underlying infrastructure?
- In the context of web development, which of the following best describes the primary difference between HTTP and HTTPS?
- Port number for data and control of FTP protocol
- What will be the output of the following code when printList is called with a linked list containing the values 1 -> 2 -> 3? class Node: def __init__(s...
- Which of the following networking devices is primarily used to connect different networks and route packets between them?
- Which of the following accurately describes the primary benefit of server virtualization in a data center environment?
- Which type of firewall is specifically designed to monitor and filter incoming and outgoing traffic based on predetermined security rules and is capable of...
- Which of the following is a characteristic feature of a Relational Database Management System (RDBMS)?
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)