Home > Back-end >  c
c

Time:09-26

The main function in the Base (3) call the superclass constructor bData=https://bbs.csdn.net/topics/3, then derive (1, 2) is not the only thing to call organization subclass constructor function, then the bData will not be assigned fell to 1, the following p. rintData () should not be 1:

CodePudding user response:

The correct output is:
Base:
bData=https://bbs.csdn.net/topics/3
Derive:
bData=https://bbs.csdn.net/topics/1dData=2

CodePudding user response:

But can't understand why the first output is 3

CodePudding user response:

Should be bData=https://bbs.csdn.net/topics/3
P. rintData show,
The b is the Base, and Derive the ultimate it doesn't matter,