Dart 2 Flashcards
some concepts of POO in dart programming language (12 cards)
What are state and behavior in Dart?
The variable represents the state of the class I mean the value the object have in specified time, and the function represents the behavior of the class I mean the actions the object can do to manipulate the state
What they call the variables inside the class?
properties
What they call functions declared inside the class?
methouds
featurs of POO?
- object
- class
- inheritance
- encapsulation
- polymorphism
- abstraction
What the operater tell is you if the object iherite from another class ?
the operater ‘is’
how to make the variables privet ?
you put “_” before the variable
How to use the privat variables ?
import the class
or
getters and setters
How to declare a getter ?
String get name() => _name;
You dont need to call the function you just put the object.name
Why do we put {} in the constructor?
to make the parameters unnecessary to put in the order in which they were declared
What is a static variable?
they are shared with all the instanse of the class
What is a static method?
they can be called with only the name of the class you don’t need to create an object
What is Mixin?
Mixing includes some classes in one class, which helps us to achieve multiple inheritance