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 major difference between linkedlist and arraylist in java?
Explain the differences between static and dynamic variables?
How do you find the independent variable?
What environment variables are required to be set on a machine in order to run Java programs?
What do you mean by byte code?
When do we use synchronized blocks and advantages of using synchronized blocks?
What is methods and methodology?
If a method is declared as protected, where may the method be accessed in java programming?
What is member in java?
What are the java ide’s?
How many java versions are there?
What is the method overriding?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What are the access modifiers in java?
Why can't we make a class private in java?