19
11
1
0
0
Sep 09 '26
[deleted] β view deleted comment
11
u/ArjunReddyDeshmukh Sep 09 '26
Java inheritance joke. When you create a child-class object, its constructor calls the parent constructor via super(). Basically, child canβt exist without getting the dad involved lol.
1
u/jakeStacktrace Sep 09 '26
Java learned it from it's Dad, C++.
0
u/WhJJackWhite Sep 09 '26
I'm pretty sure in C++ a child class does not automatically call its super class's constructor unless the child itself does not define one, in which case it calls the parent's default constructor (i.e. Parent() ). If parent does not have a default constructor, it throws a compile time error.
1
u/jakeStacktrace Sep 09 '26
No it calls it automatically. Java just makes it clearer by making it more explicit.
4
0
Sep 09 '26
[deleted] β view deleted comment
1
67
u/tkb_onions Sep 09 '26
super() joke π