Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Interface
- interface BlackColor{
- feed(): string
- }
- interface fourLegs {
- pet(): string
- }
- // Class GrandParents
- class Animal {
- photo(): string {
- console.log('smile to the photo');
- }
- }
- // class Parents
- class Cat extends Animal implements fourLegs {
- pet(): string {
- console.log("you can pet them");
- }
- sound(): string {
- console.log('can Meaoouuuw');
- }
- }
- // Class son
- class EuropeanCat extends Cat implements BlackColor {
- color: string;
- }
- // Class son
- class ChartreuxCat extends Cat {
- }
- //class Parents
- class Dog extends Animal implements fourLegs {
- pet(): string
- }
- sound():string {
- console.log('can bark');
- }
- //class son
- class TerreNeuveDog extends Dog implements BlackColor {
- feed(): string {
- console.log("you have to feed them");
- }
- }
- // class son
- class MoonMoonDog extends Dog {
- }
- // class Parents
- class Birds extends Animal {
- fly(): string {
- console.log('can fly')
- }
- }
- //class son
- class Mesange extends Birds {
- }
- //class son
- class Merle extends Birds implements BlackColor{
- feed(): string {
- console.log("you have to feed them");
- }
- }
- //class Parent
- class Fish extends Animal{
- swim(){
- console.log('can swim') }
- }
- //class Son
- class Thon extends Fish {
- }
- class son
- class Shark extends Fish {
- }
- class Worm extends Animal {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement