Sharad Gupta

Sharad Gupta

  • 98
  • 19.7k
  • 8.6m

Dart default class for an interface

Jul 18 2012 1:05 AM
Dart introduce default class for an interface like-
//---------------------------

interface Dartinterface default BasicInterface{

  MyInterface();

  Dartinterface();

}

class BasicInterface implements Dartinterface{

  MyInterface(){

    print("I an a inteface");

  }

}

void main(){

  //BasicInterface obj = new BasicInterface();

  Dartinterface obj = new Dartinterface();

  obj.MyInterface();
}

-----------------------------------------------//

but i can not understood what is the main advantage of that default class interface.



Answers (1)