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 all statements are correct about Sorting
- Which of the following best describes the ACID properties in the context of transactions in a database?
- Which of the following is NOT a property of database transactions according to the ACID model?
- What is a primary function of a hypervisor in virtual machine environments?
- In JavaScript, which method is used to parse a string into a JSON object?
- What is a common security control used to protect sensitive data during transmission over the internet?
- Given the following code snippet, what will be the output when the function findMax is called with the array arr = [1, 5, 3, 9, 2]? def findMax(arr): ...
- Which file system is commonly used by modern Windows operating systems?
- In a CI/CD pipeline, which of the following represents the most critical failure point that could delay the entire software release cycle?
- Given the following code snippet implementing a Round Robin CPU scheduling algorithm, what will be the output when the processes are scheduled? def round_r...
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)