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

Is alive and join method in java?

784


what is server side caching?

1846


What is hashing in java?

789


Where is java located?

757


What are three types of loops in java?

820


How do you allocate memory to object?

743


What is difference between equals and hashcode method?

800


Explain what is Marker interface?

859


Explain the difference between arraylist and linkedlist in java?

722


Define canvas?

766


What is the difference between final, finally and finalize() in java?

811


How many types of classes are there in java?

814


How does the java compiler work?

744


Can a class be private or protected in java?

816


Why bytecode is called bytecode?

834