Explain, why the constructor is required in implemented
class?
Answer Posted / snehaaa
when u have the class name like bicycle,how u'l initialize the values for bicycle with different 1 parameters,2 parameters,
3 parameters by using object?. for that u'l create example like 3 parameter constructors -> bicycle(speed,wheels,gear)and cal this constructor like bicycle b=new bicycle(10,2,4); this is use of constructor to initialize the values for class
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we override private constructor in java?
What is the maximum size of array in java?
What is <> used for in java?
What are methods and how are they defined?
What is assembly condition codes?
Can we override constructor in java?
What is the purpose of lambda expressions?
What is meant by memory leak?
What is string :: npos?
What is binary search in java?
why using interface interface ?
What is a ternary operator in java?
What is the Scope of Static Variable?
How can you read content from file in java?
Explain polymorphism citing an example.