why the constructor should be used in class,if there is no
constructor what will happen?
Answer Posted / ravikiran
constructor is used to initialize the variables during the
creation of instances.
If there is no constuctor no object will be gets created.
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
How many bits is a boolean?
What is functional interface in java example?
What is a nested list?
5 Coding best practices you learned in java?
How do you override a private method in java?
What is a flag variable?
What are different types of arrays?
Why string is not thread safe?
How garbage collection is done in java?
How java is similar to c?
How is hashcode calculated in java?
Can a method inside a interface be declared as final?
What is a text string?
What is a subsequence of a string?
What is nextint java?