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
how can i use a nonsynchronized hashtable?
How do you detect memory leaks?
How many ways can you break a singleton class in java?
Explain about version control?
What is string :: npos?
What is the private method modifier?
What is the difference between state-based unit testing and interaction-based unit testing?
Is a case study a method or methodology?
How do you compare two objects?
What is variable and example?
Can we have multiple classes in a single file?
Can we define private and protected modifiers for the members in interfaces?
Why singleton class is used in java?
What is run time allocation?
How would you convert bytes to string?