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

os is developed in c no java is more secured then c na why dont the os developed is developed using java

3836


Is java pass by value or pass by reference?

751


Can we have a try block without catch block?

759


What is the difference between JDK and JVM?

869


Is there any difference between synchronized methods and synchronized statements?

811


When is finally block not called?

821


Is null in java?

749


Can we convert integer to string in java?

824


explain autoboxing in java?

777


What is a cup of java?

795


Explain listiterator and methods in listiterator?

756


What is the difference between notify and notifyall method?

826


Why java is object oriented?

791


What do you understand by java?

756


Differentiate between a constructor and a method? Can we mark constructors final?

951