Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Animaux {
- type: string;
- color: string;
- }
- function photo(animaux: Animaux) {
- console.log("I'm " + animaux.type + " you can take a picture of me ");
- }
- class Chat {
- type: string;
- color: string;
- constructor(type: string, color: string) {
- this.type = type;
- this.color = color;
- }
- photo() {
- console.log("I'm " + this.type + " you can take a picture of me ");
- }
- miaul(){
- console.log('Miaouuuuuuh')
- }
- }
- class Chien {
- type: string;
- color: string;
- constructor(type: string, color: string) {
- this.type = type;
- this.color = color;
- }
- photo() {
- console.log("I'm " + this.type + " you can take a picture of me ");
- }
- aboie(){
- console.log("Waaaaaaaf")
- }
- }
- class Oiseaux {
- type: string;
- color: string;
- constructor(type: string, color: string) {
- this.type = type;
- this.color = color;
- }
- photo() {
- console.log("I'm " + this.type + " you can take a picture of me ");
- }
- vole(){
- console.log("Je vooooolee car je suis un "+ this.type)
- }
- }
- class Poisson {
- type: string;
- color: string;
- constructor(type: string, color: string) {
- this.type = type;
- this.color = color;
- }
- photo() {
- console.log("I'm " + this.type + " you can take a picture of me ");
- }
- nage(){
- console.log("Je nage et pas dans un bocal")
- }
- }
- class chatE extends Chat {
- nbPates: number;
- constructor(type:string, color:string, nbPates:number) {
- super(type, color);
- this.nbPates = nbPates;
- }
- caresse() {
- console.log("Tu peux me caresser car" + this.nbPates+ " pattes");
- }
- noir() {
- console.log("Je suis noir")
- }
- }
- class chatC extends Chat {
- nbPates: number;
- constructor(type:string, color:string, nbPates:number) {
- super(type, color);
- this.nbPates = nbPates;
- }
- caresse() {
- console.log("Tu peux me caresser car" + this.nbPates+ " pattes");
- }
- }
- class chienMoonMoon extends Chien {
- nbPates: number;
- constructor(type:string, color:string, nbPates:number) {
- super(type, color);
- this.nbPates = nbPates;
- }
- caresse() {
- console.log("Tu peux me caresser car" + this.nbPates+ " pattes");
- }
- }
- class chienTerreNeuve extends Chien {
- nbPates: number;
- constructor(type:string, color:string, nbPates:number) {
- super(type, color);
- this.nbPates = nbPates;
- }
- caresse() {
- console.log("Tu peux me caresser car j'ai " + this.nbPates + " pattes");
- }
- noir() {
- console.log("Je suis noir")
- }
- }
- class Merle extends Oiseaux {
- constructor(type:string, color:string, ) {
- super(type, color);
- }
- noir() {
- console.log("Je suis noir")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement