From 703969bb4ae89a6d2ddc557888db4a39096ddc1e Mon Sep 17 00:00:00 2001 From: Binod Bhandari Date: Sat, 5 Mar 2022 16:40:53 +0545 Subject: [PATCH 1/2] maintained program structure --- .vscode/student.dart => student.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .vscode/student.dart => student.dart (100%) diff --git a/.vscode/student.dart b/student.dart similarity index 100% rename from .vscode/student.dart rename to student.dart From d9653e3eac1426b80d8912e369d527ac1620a686 Mon Sep 17 00:00:00 2001 From: Binod Bhandari Date: Sat, 5 Mar 2022 19:14:10 +0545 Subject: [PATCH 2/2] day 2 update --- student.dart | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/student.dart b/student.dart index 6ae40e1..6a7792f 100644 --- a/student.dart +++ b/student.dart @@ -1,36 +1,32 @@ -//parent class +//parent class or super class class Teacher { - String name = ''; - String position = ''; - int age = 0; + String name; + String position; + int age; - Teacher(String name, String position, int age) { - this.name = name; - this.age = age; - this.position = position; + Teacher({ + this.name = '', + this.position = '', + this.age = 0, + }); - void display() { - print( - 'Name of teacher is $name , position is $position and his age is $age'); - } + void display() { + print( + 'Name of teacher is $name , position is $position and his age is $age'); } } -//child class -//TODO1 : declare the class +//child class or base class + class Student extends Teacher { -//TODO2: DECLARE THE PROPERTIES + Student(String name, int age) : super(name: name, age: age) {} -//TODO3: DECLARE THE CONSTRUCTOR - Student(String name, String position, int age) : super(name, position, age) {} -//TODO 4: DECLARE THE METHODS - @override void display() { print('Name of student is $name and his age is $age'); } } void main() { - Student s1 = Student('binod', 'head', 23); + Student s1 = Student('binod', 23); s1.display(); }