第二个Dart程序

import'dart:html';

int i = 100;

String str = "sum is ";

int n = 110;

void main() {

    A a = new A();

    a.sum();

}

void btnClick(MouseEvent e){

  window.alert("HelloDart");

}

class A{

  int sum(){

    window.alert((i + n).toString()); 

  }

}

这货和Java一样, 就不解释了.

原文地址:https://www.cnblogs.com/mohe/p/2956838.html