Breaking News: Grepper is joining Read the official announcement!
Check it out

Is it possible to use this() and super() both in same constructor?

Pragya Keshap answered on February 4, 2023 Popularity 5/10 Helpfulness 1/10


More Related Answers

  • how to call super class constructor in python two classes
  • difference between this and super
  • The Super Function
  • how to use the super
  • super vs super() ruby
  • super vs super() ruby
  • python why call super(class).__init__()
  • c++ constructor call superclass
  • what is the superclass in exceptions
  • what is a super class
  • subclass constructor invokes constructor of super class
  • What would be the behavior if this() and super() used in a method?
  • super class java
  • python call super constructor
  • super method with class in javascript
  • how to do two constructors with super
  • how to do two constructors with super
  • javascript vererbung Klasse extends super constructor
  • can subclass method infere exceptions of its superclass method
  • Show the difference between this() and super() with help of a code
  • how to use the super
  • how to use the super
  • Example of inheritance and constructor in subclass
  • What is the purpose of using super constructor with props argument?
  • • What is inheritance? Explain with example. Or differentiate between super class and subclass. Also write a program to show the reusability concept.
  • the super() function in Python

  • Is it possible to use this() and super() both in same constructor?


    No, Java does not allow using both super() and this() in same constructor.

     As per Java specification, super() or this() must be the first statement in a constructor.

    Popularity 5/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on Feb 04 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.