why the constructor should be used in class,if there is no
constructor what will happen?

Answer Posted / ravikiran

constructor is used to initialize the variables during the
creation of instances.
If there is no constuctor no object will be gets created.

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are operators and its types?

576


Differentiate between the constructors and methods in java?

511


What are benefits of java?

562


What is the super void?

462


Is alive and join method in java?

540






What is java jit compilers?

562


what is the difference between preemptive scheduling and time slicing? : Java thread

537


What is java ceil?

573


How do you access command-line arguments within the code?

573


Which class is the superclass of all classes?

604


How are observer and observable used in java programming?

545


What are the important features of Java 11 release?

582


What does nullpointerexception mean?

618


What is null data type?

538


What is the use of math abs in java?

552