why constructor dont have returns type?

Answer Posted / subrat

This is what differenciates constructor from a method. If
constructor have a return type then the JVM will not treat
constructor as constructor but as method.

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parts of a method?

531


What is difference between final and immutable?

550


What does += mean coding?

503


What is an example of a conditional statement?

559


What are the advantages of arraylist over arrays?

558






What is difference between next () and nextline () in java?

530


How can a gui component handle its own events?

586


Which api is provided by java for operations on set of objects?

898


How do I run java on windows?

521


Detail discussions on JVM, memory management and garbage collector.

548


What does arrays sort do in java?

531


What do you mean by Hash Map and Hash Table?

590


Why do we create threads in java?

568


what is synchronization? : Java thread

553


What is the difference between a choice and a list?

595