App Development PPT 5
App Development PPT 5
• Class
• Object
• Inheritance
• Polymorphism
• Interfaces
• Abstract class
Dart Class
Accessing Variable
Accessing Function
Class Constructor
The this keyword is used to refer the current class object. It indicates
the current instance of the class, methods, or constructor.
Inheritance
Dart inheritance is defined as the process of deriving the properties and characteristics of
another class. It provides the ability to create a new class from an existing class. It is the most
essential concept of the oops(Object-Oriented programming approach). We can reuse the all the
behavior and characteristics of the previous class in the new class.
• Parent Class:
A class which is inherited by the other class is called superclass or parent class. It is also
known as a base class.
• Child Class:
A class which inherits properties from other class is called the child class. It is also known as
the derived class or subclass.
Inheritance
Method Overriding
Circle(this.radius);
@override
double calculateArea() {
return 3.14 * radius * radius;
}
}
Rectangle(this.length, this.width);
@override
double calculateArea() {
return length * width;
}
}
void main() {
Circle circle = Circle(5.0);
Rectangle rectangle = Rectangle(4.0, 6.0);