If the name of the class is "Yellow", what can be the possible name for its constructors?

ICSE Class 10 Computer Applications PYQ · 2024 Paper · Section A

1(xv)1 Mark · 2024 · Section A · 2024 Paper

If the name of the class is "Yellow", what can be the possible name for its constructors?

Show SolutionHide Solution↓

Yellow

Reason — In Java, a constructor must have the same name as the class. It initializes an object when it is created. Since the class name is Yellow, the constructor's name must be exactly Yellow, matching the class name including capitalization.

← Previous questionNext question →

Browse the free Computer Applications sample bank