Created
January 30, 2020 23:41
-
-
Save SOS77777/0ecdf46bcb4cdd293e2d0802f297b279 to your computer and use it in GitHub Desktop.
oop
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/thirteen+ able .dart'; | |
main() { | |
} |
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
// interface هى عبارة عن تهئة للدوال بستخدام كلمه فقط لا غير مثل هذا الكود (implements) | |
// تب ليه لا نستخدم الوارثة بدل من ذلك لان ذلك يوفر لنا موجهود بأنشاء اكثر من دالة وايضا وضع فيها الاكشن المراد فعله | |
//الخلاصة هى عبارة عن تهيئة للاكشن | |
// اما ابستركت هى دالة لاتفعل اى شئ الا ان تهيى فيها المعطيات | |
import 'package:Education1/thirteen+%20able%20.dart'; | |
import 'package:Education1/typeAnimal.dart'; | |
class Lion extends Animal implements qwe{ | |
Lion() : super('lion', 'lion', 74); | |
@override | |
void eating() { | |
// TODO: implement eating | |
} | |
@override | |
void jump() { | |
// TODO: implement jump | |
} | |
@override | |
void swimming() { | |
// TODO: implement swimming | |
} | |
} |
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 qwe { | |
void eating(){} | |
void swimming(){} | |
void jump(){} | |
} |
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
abstract class Animal { | |
String _type; | |
String _name; | |
int _age; | |
Animal(this._type, this._name, this._age); | |
int get age => _age; | |
set age(int value) { | |
_age = value; | |
} | |
String get name => _name; | |
set name(String value) { | |
_name = value; | |
} | |
String get type => _type; | |
set type(String value) { | |
_type = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment