Explain, why the constructor is required in implemented
class?
Answer Posted / vimalan
constructor is used for initializing the class
variables.if constructor is not there,variables might be
taken the garbage values.To avoid garbage
values ,constructor is used.
Example:
Java:
int i;
initial value i=0;
C:
int v;
v=8823
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is the use of parseint in java?
What is the difference between logical data independence and physical data independence?
How to invoke external process in java.
Differentiate between the constructors and methods in java?
What is an argument in java?
How do you reverse sort in java?
What is the differences between c++ and java? Explain
Can we sort set in java?
What is a "pure virtual" member function?
How many types of array are there?
What does this () mean in constructor chaining concept?
What is unsigned char?
What is the new line character?
What is the use of optional ?
How do you compare two objects?