tag:blogger.com,1999:blog-5327046495053561503.post8083771551779819440..comments2023-07-25T13:09:12.340+05:30Comments on Tech Tutorials: super Keyword in Java With ExamplesAnshudeephttp://www.blogger.com/profile/05912349277663872766noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5327046495053561503.post-47000308261242535112017-03-15T21:23:06.900+05:302017-03-15T21:23:06.900+05:30If a constructor is explicitly defined for a class...If a constructor is explicitly defined for a class, then the Java compiler will not insert the default no-argument constructor into the class. As you see in the example given, since Shape has a 2 arg constructor so default constructor won't be automatically inserted. In that example you can comment the no-arg constructor and comment the explicit super call then you should get an error. Constructor in Javahttp://netjs.blogspot.com/2015/04/constructor-in-java.htmlnoreply@blogger.comtag:blogger.com,1999:blog-5327046495053561503.post-73146669287298763442017-03-13T17:02:34.508+05:302017-03-13T17:02:34.508+05:30Note: If a constructor does not explicitly invoke ...Note: If a constructor does not explicitly invoke a superclass constructor, the Java compiler automatically inserts a call to the no-argument constructor of the superclass. If the super class does not have a no-argument constructor, you will get a compile-time error.<br /><br />The Sentence "If the super class does not have a no-argument constructor, you will get a compile-time error." is it correct ? . I tried and didn't got any compile time or run time exception. Anonymoushttps://www.blogger.com/profile/16445801629863847959noreply@blogger.com