42.2k views
3 votes
True or False and WHY:
Constructors can have names different from theirclasses.

1 Answer

2 votes

Answer:

False

Step-by-step explanation:

Constructors have to have the same name as their classes for proper syntax, if their names are different it will result in an error. Methods contained within the class can/should have different names, it is allowed because methods require return types while constructors cannot have return types.

User Rzskhr
by
4.7k points