English

The correct statement to create an object named mango of class fruit: - Computer Applications

Advertisements
Advertisements

Question

The correct statement to create an object named mango of class fruit:

Options

  • Fruit Mango = new fruit();

  • fruit mango = new fruit();

  • Mango fruit = new Mango();

  • fruit mango = new  mango();

MCQ

Solution

fruit mango = new fruit();

Explanation:

The class and object names should be the same, as specified in the query.

shaalaa.com
Objects as Instances of a Class
  Is there an error in this question or solution?
2023-2024 (February) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.