Advertisements
Advertisements
प्रश्न
The name of a constructor is:
पर्याय
same as the class name
different from the class name
supposed to be a keyword
must be written in uppercase
MCQ
Advertisements
उत्तर
same as the class name
Explanation:
In programming languages like Java, a constructor is a special function used to initialise objects. To let the computer know it is a constructor and not a regular method, its name must match the class name exactly.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 4: Constructors - Exercises [पृष्ठ ११४]
