Yog, cov chav kawm paub daws teeb meem muaj vtables, kuj muaj cov kev paub daws teeb meem ntshiab (cov no tuaj yeem siv tau thiab hu ua), thiab yog - lawv tus tsim tsim pib pib cov kev nkag ntshiab rau ib qho tus nqi teev.
Cov chav kawm paub daws teeb meem puas muaj kev ua haujlwm virtual?
Ib chav kawm paub daws teeb meem muaj tsawg kawg ib qho kev ua haujlwm dawb huv. Koj tshaj tawm qhov kev ua haujlwm dawb huv los ntawm kev siv tus qauv ntshiab (=0) hauv kev tshaj tawm ntawm tus tswv cuab virtual hauv kev tshaj tawm hauv chav kawm.
Puas txhua chav kawm muaj lub rooj virtual?
Yog li cov lus teb luv yog no. Tus qauv tsis qhia qhov no.
Puas chav kawm paub daws teeb meem tsis muaj cov haujlwm virtual?
Cov chav kawm paub daws teeb meem (tshwj tsis yog cov haujlwm ua haujlwm dawb huv) tuaj yeem muaj cov tswvcuab sib txawv, tsis yog-virtual functions, kev ua haujlwm tsis tu ncua, kev ua haujlwm zoo li qub, thiab lwm yam. Cov khoom ntawm cov chav kawm paub daws teeb meem tsis tuaj yeem ua rau tsis txaus ntseeg..
Puas yog chav kawm paub daws teeb meem tsim khoom?
Tsis yog, peb tsis tuaj yeem tsim ib qho khoom ntawm chav kawm paub daws teeb meem … Qhov kev siv sib txawv yog siv los xa mus rau cov khoom ntawm cov chav kawm uas tau muab los (subclasses ntawm chav kawm paub daws teeb). Ib chav kawm paub daws teeb meem txhais tau tias zais qhov kev siv thiab qhia cov ntsiab lus ua haujlwm rau tus neeg siv hu ua Abstract class.