What is constructor

Answer Posted / nagendra kumar

1.A Constructor is Just like a method without return type.
2.The Class name and the Constructor name should be same.
3.Constructor are useful to initialize instance variable
with their default values.
4.Constructor can be executed only once while creating the
Object.

Is This Answer Correct ?    43 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you reverse sort a list in java?

517


What are predefined functions?

582


List some java keywords sun like c, c + + keywords?

592


What is array command?

563


What does this mean java?

563






Where local and global variables are stored?

551


How are this() and super() used with constructors in java programming?

577


What is the difference between the paint() and repaint() methods?

595


Write a program to print count of empty strings in java 8?

545


What are the differences between include directive and include action?

553


Does list allow duplicates in java?

524


Explain reverse a linked list iterative solution in java?

504


Can a main method be declared final?

588


Define interface in java?

609


What is the advantage of functional interface in java 8?

531