Quantcast
Channel: How do I call on the super class' constructor and other statements in Dart? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Shailen Tuli for How do I call on the super class' constructor and other statements in Dart?

$
0
0

You can call super in this way:

abstract class Animal {  String name;  Animal (String this.name);}class Dog extends Animal {  Dog() : super('Spot') {    print("Dog was created");  }}void main() {  var d = new Dog(); // Prints 'Dog was created'.  print(d.name);     // Prints 'Spot'.}

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>