Dart Lecture 2

 // ignore_for_file: non_constant_identifier_names


void main() {

  // var userName = 10;

  // print(userName);


  // Sum() {

  //   print("sum");

  // }


  // Sum();


  UserData user = UserData();


  user.father_name = "Hassan";

  user.name = "ali";


  user.showName();


  UserData().age = 10;


  print(UserData().age);

}


class UserData {

  String name = '';

  String father_name = '';

  int age = 0;


// method

  showName() {

    // print(name + father_name);

    print("$name your father name is ${father_name.toUpperCase()}");

  }

}

Comments