Quick Start Guide to Dart Programming by Sanjib Sinha

Quick Start Guide to Dart Programming by Sanjib Sinha

Author:Sanjib Sinha
Language: eng
Format: epub
ISBN: 9781484255629
Publisher: Apress


class Cat extends Animal {

//overriding parent constructor

//although constructors are not inherited

Cat() : super(){

print("I am child cat class overriding super Animal class.");

}

Cat.namedCatConstructor() : super.namedConstructor(){

print("The child cat named constructor overrides the parent animal named constructor.");

}

@override // method overriding

void showName(){

print(this.name);

}

@override

void eat(){

super.eat();

print("Cat doesn't eat vegetables..");

}

}

main(List<String> arguments){

var cat = Cat();

cat.name = "Meaow";

cat.showName();

cat.eat();

var anotherCat = Cat.namedCatConstructor();

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.