Question

Design a class named Car, having registration number, model and engine as its private members. Here engine is an object of a class called Engine with the private members: Chassis number and make. Define a suitable constructor of Car and override toString() Method to print the details of a car. Assume appropriate data types for the instance members of the classes. Write a Java program to test the above class.

02 Apr 2022
Answer :
Word Count : 244

Here's a Java program that defines a class named Car and another class named Engine as described in your question. The Car class has private members for registration number, model, and an instance of the Engine class. It also defines a constructor to initialize these members and overrides __________ ___ ______ __________ _______ _______ ______.
_____ _____ ___ ___ ___ __________ ____ ________ ____.
______ ________ ______ ____ _________ _________ ________ _______ ________.
_______ __________ ____ ___ ________ ________ _____ _________.
_________ ______ _____ _________ _____ _____ ________.
___ _____ ________ ____ ___ _________ _________ ___ ___ _______.
____ ________ ________ ____ ____ ______ _________ ____ ______ _________ ______.
________ ____ ________ ___ _________ ________ _______ ______.
____ ___ _____ _________ ________ ______.
_____ _____ __________ ________ ________ _____ __________ ___ ____ __________ _____.
_____ ________ __________ ________ _____ ___ ___ ______.
_________ ________ ________ ___ ______.
____ ______ __________ __________ ____ _______ __________ _____ _______.
____ ___ ________ ________ ________ _________ _____ __________ _______ _________ _________.
____ _______ _____ __________ ________ _____ ____ _______ ______ _______ _______ _____.
_____ ____ __________ ________ _________ ___ ____ ________ _________ _____ _________.
____ __________ ______ _________ _____ ____ ___ ____ _________.
____ ________ ___ _______ _______ _________ ________ _______ ________ ____ _______.
____ __________ _________ __________ ______ ___ ________ ____ __________.
______ ________ ______ ___ _____ __________ ______ __________ ____ __________ _____ ___.
__________ _____ ____ ______ ____ _____ _____ ____.
__________ ____ ____ ___ _________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Design a class named Car, having registration number, model and engine
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→