What is the difference between this() and super()?
Answer Posted / puneet khanna
this is used to either call another constructor of the same
class whose object is used to call a method; or whose
constructor is being used to instantiate a class.
This refers to the current object whose reference variable
is used to call method or this refers to the current object
in action,
Super refers to the immediate super class, super(); is
itself placed in the constructor of the class whose super
class doesnt has a constructor declared;for consructor
chaining mechanism.
Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
What is the class in java?
What are strings in physics?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
How can you handle java exceptions?
What is executor memory?
Why is stringbuffer not immutable?
What is identifier give example?
Does java runtime require a license?
Define inheritance with reference to java.
Write a java program to print fibonacci series?
Is array synchronized in java?
Can we override the static method?
What is contract between hashcode and equal method?
What is callablestatement? How you can call stored procedure to pass in parameter?
What is casting in java programming?