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 the major difference between linkedlist and arraylist in java?

638


Explain the differences between static and dynamic variables?

690


How do you find the independent variable?

606


What environment variables are required to be set on a machine in order to run Java programs?

720


What do you mean by byte code?

602






When do we use synchronized blocks and advantages of using synchronized blocks?

751


What is methods and methodology?

630


If a method is declared as protected, where may the method be accessed in java programming?

584


What is member in java?

578


What are the java ide’s?

678


How many java versions are there?

651


What is the method overriding?

711


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

631


What are the access modifiers in java?

671


Why can't we make a class private in java?

616