Difference between this(), super()?
Answer Posted / nikhlesh gupta
this() call one of user define constructor inside another user constructor of the same class such as this(a), this(a,b) & so on.
super() call one of base class constructor inside the derive class constructor such as super(a), super(a,b) & so on.
Is This Answer Correct ? | 26 Yes | 5 No |
Post New Answer View All Answers
How can constructor chaining be done using this keyword?
What are different data structures in java?
Define how can we find the actual size of an object on the heap?
What is the use of private static?
How to display all the prime numbers between 1 and 100
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
What is class and its types?
Explain the use of javap tool.
What is a lightweight component?
What are the actions that can occur when a thread enters blocked state?
Why hashset is used in java?
What is type inference in java8?
Is binary a low level language?
Can a final method be overloaded?
What is a method header?