Explain, why the constructor is required in implemented
class?
Answer Posted / ejp
A constructor isn't required so the question is futile. Both
answers above are wrong.
Specifically, in reply #1, 'if constructor is not
there,variables might be taken the garbage values' is itself
complete garbage.
Reply #2, is mostly irrelevant, but this statement 'to call
them we need pass parameters in main method' is also wrong.
Parameters are not required, and the reference to the main
method is pointless.
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What are parsing rules?
What is the purpose of using the java bean?
Are strings immutable in java?
What is Mutex (Mutual Exclusion Object) ?
What is queue in java?
What are the escape sequences in java?
What is the use of using enum to declare a constant?
What is garbage collector?
Does java return by reference?
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
How do you detect memory leaks?
What is the purpose of java?
What is the synchronized method modifier?
Can we declare an array without size in java?
What is protected access modifier?