Can constructors be parameterized?



Can constructors be parameterized?..

Answer / Rafi Ullah Baqai

Yes, constructors can have parameters in Java. The constructor takes input values (arguments) and uses them to initialize the object's state. Constructors are called when an object is created using the new keyword.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOAD Interview Questions

What is virtual multiple inheritance?

1 Answers  


What is the use of interface?

1 Answers  


What is a try/ catch block?

1 Answers  


Can encapsulation be called as a security device?

1 Answers  


What is the function of messaging metaphor?

1 Answers  


Difference: 'uses', 'extends', 'includes'

7 Answers   Cognizant, Protech, TY, University,


Classes and structs support inheritance. Is this statement true or false?

1 Answers  


What is difference between polymorphism and normalization?

1 Answers   NIIT,


Explain the concept of multiple inheritance (virtual inheritance). Write about its advantages and disadvantages?

1 Answers  


What is the difference between an Abstract class and Interface?

1 Answers  


Does a class inherit the constructor of its super class?

1 Answers  


What is static polymorphism?

1 Answers  


Categories