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
What are the restrictions that are applied to the java static methods?
What is scope & storage allocation of global and extern variables? Explain with an example
How do you add an element to a hashset in java?
What if constructor is protected in java?
Why string is not a wrapper class?
What is an exception in java?
Why hashmap is used in java?
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?
What is multi level inheritance in java?
What are java packages?
Can inner class extend any class?
Is there a case when finally will not execute?
What is the difference between static (class) method and instance method?
Can we override constructors in java?
Can we override compareto method?