What is the difference between constructor and method?
Answer Posted / sameer inamdar
Constructor must have the same as the class name,
whereas we can give any name to the method.
Constructor doesnt have any return type not even void,
whereas method must have valid return type or void if
nothing is return.
Constructor will implicitely invoke at the time of
object creation, whereas method must invoke explicitely
with the object.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Does java map allow duplicates?
What is finally in Java?
describe method overloading
what is mutual exclusion? : Java thread
What is data type in computer?
What is java argument list?
What is hash code collision?
Does constructor creates the object ?
How does sublist works in java?
If you do not want your class to be inherited by any other class. What would you do?
Is the milky way in a void?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is the difference between class & structure?
What is jit compiler ?
What is difference between public static and void?