+2 votes
in JAVA by
Can a constructor have different name than a Class name in Java?

1 Answer

0 votes
by
Constructor in Java must have same name as the class name and if the name is different, it doesn’t act as a constructor and compiler thinks of it as a normal method.

Related questions

0 votes
asked Oct 27, 2020 in JAVA by sharadyadav1986
0 votes
asked Oct 27, 2020 in JAVA by sharadyadav1986
...