. What are the differences between constructor and method of a class in Java?
Answer Posted / nashiinformaticssolutions
Initializing the state of the object is done by constructors. A function Object () { [native code] }, like methods, contains a group of statements (or instructions) that are carried out when an object is created. A method is a group of statements that work together to complete a certain task and return the outcome to the caller. A method has the option of working without returning anything.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does java se mean?
Can singleton class be serialized?
What is the difference between heap memory and stack memory?
What is the += operator called?
What is a boolean used for?
Can we create more than one object singleton class?
What is java thread dump, how can we get java thread dump of a program?
What is use of set in java?
How many arguments can a method have java?
How do you clear a method in java?
What is private public protected in java?
What is consumer in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
Can you make a constructor final in Java?
What is return used for in java?