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

Answer Posted / yamini

Constructor is used initialize certian paramameters to each
object on their creation.We can also overload
constructors.So we can initialize objects with diff params.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is consumer in java?

518


What are the core java topics?

558


Does java initialize arrays to zero?

499


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

549


Is java free for businesses?

577






Can we force the garbage collection to run?

530


What is the argument in java?

487


What is locale in java?

571


What are register variables what are the advantages?

443


How to convert string to char and vice versa?

511


Is empty in java?

576


What is the purpose of garbage collection in java?

649


What differences exist between iterator and listiterator?

561


What is thread synchronization in java?

477


What is the vector class in java programming?

558