Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
If there are three levels of inheritance,
C1,C2, andC3, and a method defined inC1is overridden inC2, but not inC3, then in aC3object's clone, inside the method, thesuperobject will refer to the wrong level -- it will refer to theC2methods instead ofC1.In the example below, in the clone, the
addxmethod fromC2gets called twice, when it should only get called once.