我想知道我該如何組織我的兩堂課。 其中之一代表Knife:只是一個簡單,堅實,基本的,就像一把菜刀。 另一個是PocketKnife,其狀態爲已打開或已關閉。 在我的代碼的類 class Knife{
public function cut() {/* do the cutting */}
}
class PocketKnife extends Knife{
private
另一個對象內部的對象和第一個對象如何重新使用組合對象背後的代碼在運行時可以確定組合對象的含義是什麼? class Calculator
{
private:
long double operand_1;
long double operand_2;
long double result;
int optr;
int multi