Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Last active January 17, 2024 15:00
Show Gist options
  • Save TheShubhamVsnv/fd411176974eb63249f38bc0772190ea to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/fd411176974eb63249f38bc0772190ea to your computer and use it in GitHub Desktop.
/*
Super is used to call the constructor or method of the immediate superclass.
It is often used in the constructor of a subclass to invoke the constructor of its superclass.
*/
public class MyChildClass extends MyBaseClass {
public void myMethod() {
super.myVirtualMethod();
// Calling the superhero parent!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment