Login
Remember
Register
Ask a Question
Can a constructor have different name than a Class name in Java?
+2
votes
asked
May 31, 2020
in
JAVA
by
SakshiSharma
Can a constructor have different name than a Class name in Java?
#java-main-class
#main-class-java
#java-constructors
#constructors-java
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 31, 2020
by
Robindeniel
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.
...