STDIO Training

45 bundles
1 file10 days ago
2

Interafce vs Abstract class - C++

class IFlying {

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849class IFlying {
	virtual void takeoff() = 0;
	virtual void fly() = 0;
	virtual void landing() = 0;
};

class ISwimming {
};

class Pourtry {
private:
	int weight;
public:
};

class Fish : public ISwimming {
};

class AirPlan : public IFlying {
};

class Duck: public Pourtry,
			public IFlying,
			public ISwimming {
private:
public:
	void takeoff() {
	}

	void fly() {
	}

	void landing() {
	}
};

class Bird: public Pourtry,
			public IFlying {
private:
public:
	void takeoff() {
	}

	void fly() {
	}

	void landing() {
	}
};