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


Please Help Members By Posting Answers For Below Questions

What is string array?

587


What is static synchronization?

581


Why does java have different data types for integers and floating-point values?

540


What is the size of a string in java?

554


What is java regex?

542






How to print an arraylist in java?

509


What is use of valueof () in java?

575


how to create multithreaded program? : Java thread

519


What is meant by the value of a variable?

462


Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

1829


Explain the overview of UDP messaging.

743


What is generic type?

579


Is arraylist ordered in java?

584


What is a vector in java?

582


What is variable and its types?

557