Multiple choice technology programming languages

The class with name exforsys and having integer data x in its have constructor name as

  1. any name

  2. x

  3. exforsys

  4. None of the Above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Java and similar object-oriented languages, a constructor must have the exact same name as its class. If the class is named 'exforsys', the constructor must also be named 'exforsys'. The constructor name cannot be arbitrary (option A), cannot be the same as a field name (option B), and option D is incorrect because there is a specific answer.