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

Which number is denoted by leading zero in java?

1040


Explain oops concepts in detail?

799


Can java inner class be static?

773


Will set allow duplicates in java?

745


Which class is the superclass of all classes?

857


Is string thread safe in java?

846


Is an array a vector?

772


Which package has light weight components in java programming?

905


How do I get 64 bit java?

731


Why is stringbuffer called mutable?

779


I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?

763


What is size of int in java?

813


What is an iterator interface in java programming?

748


How many bytes is a string java?

773


Why do we create public static method in java?

826