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 string array?
What is static synchronization?
Why does java have different data types for integers and floating-point values?
What is the size of a string in java?
What is java regex?
How to print an arraylist in java?
What is use of valueof () in java?
how to create multithreaded program? : Java thread
What is meant by the value of a variable?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
Explain the overview of UDP messaging.
What is generic type?
Is arraylist ordered in java?
What is a vector in java?
What is variable and its types?