Once again, the code you posted is incomplete, so I'm assuming you've done something like this:
This looks right to me. The method in D over-rides the one in C, but you're giving it a value for x so it uses that instead of the default value. When D.sum() calls C.sum(), it already has values for x and y, so the defaults in C are ignored.
Maybe slow down a bit and make sure that your code is doing - and
testing - what you think it's doing?