. What are the differences between constructor and method of a class in Java?
Answer / 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 |
Does java return by reference?
How is java created?
What is the difference between class & structure?
What is an object?s lock? Give name of object?s that have locks?
What is use of map in java?
What is finalize()? Is finalize() similar to a destructor?
Can a constructor call another constructor?
What are advantages of exception handling in java?
Is 0 true or is 1 true?
What is the default value stored in Local Variables?
What is anonymous class?
What are the common problems you have faced while implementing Java?