What is the difference between method and constructor ?
Answer Posted / malli
constructor: 1)It is special type of member function.
2)it should not support any return type.
3)it should not support any static and final
4)mainly we can use for object initialization
method:
1)it is normal member function
2)it support return type and static final.
3)methods for to develop business logic we can use.
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Can classes declared using the abstract keyword cab be instantiated?
What is difference between arraylist and list in java?
How do you write a good declaration?
What value is a variable of the string type automatically initialized?
What is singleton class in ruby?
What do you mean by composition in java?
How do you create immutable object in java?
What is collection sort in java?
What is the protected method modifier?
Is Constructor possible in abstract class in java ?
What is the primitive type byte?
How do you check if a character in a string is a digit or letter?
What is the r character?
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
What are constants?