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 do you sort in java?
What is output buffer?
Is a string literal?
Which package has light weight components in java programming?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
What is the difference between import java.util.date and java .util?
What is use of valueof () in java?
Explain what is Marker interface?
What is mean by encoding?
What is the core java?
Explain the hierarchy of java exception classes?
What is the purpose of a parameter?
What are packages in java?
What modifiers may be used with an inner class that is a member of an outer class in java programming?
How does compareto method work?