Created
January 26, 2020 00:36
-
-
Save SOS77777/4d6297e3b0a52e262e1987bb1568170e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human{ | |
String _name ; | |
String _address; | |
int _age; | |
//الاخصار الصحيح في الويندوز Alt+Insert to build getter and setter | |
Human(this._address , this._name , this._age); | |
// int get age => _age; | |
// String get address => _address; | |
//String get name => _name; | |
//يمكن انشاءها ايضا بهذه الطريقة | |
void setname (String name){ | |
this._name = name; | |
} | |
String getname (){ | |
return this._name; | |
} | |
void setage (int age ){ | |
this._age = age ; | |
} | |
int getage (){ | |
return this._age; | |
} | |
void setaddress (String address){ | |
this._address = address; | |
} | |
String getaddress (){ | |
return this._address; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:Education1/episode twelve.dart'; | |
main() { | |
Human human = Human('sadsad', 'asd', 33); | |
human.setname('abo roomy'); | |
print(human.getname()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment