摘要:
class Person { String name = '张三'; int age = 20; Person(this.name, this.age); void printInfo() { print("${this.age} ${this.name}"); } } void main() { 阅读全文
摘要:
class Person { static String name = '张三'; int age = 20; // 静态方法不能访问非静态成员 ,非静态方法可以访问静态成员 static void show() { print(name); } // 非静态方法可以访问静态成员 void prin 阅读全文
摘要:
// class Rect { // num heihgt; // num width; // Rect(this.heihgt, this.width); // area() { // return this.heihgt * this.width; // } // } class Rect { 阅读全文