Constructor In Dart - Learn Dart Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024

ความคิดเห็น • 22

  • @kopihannan3226
    @kopihannan3226 หลายเดือนก่อน +2

    Bro please create flutter tutorial ❤

  • @Кыргызстан-менинмекеним
    @Кыргызстан-менинмекеним หลายเดือนก่อน

    you are really handsome in this video, keep up the good work.

  • @jaydobariya8
    @jaydobariya8 5 หลายเดือนก่อน +1

    class Patient{
    String? name;
    int? age;

    Patient(this.name,this.age);
    }
    void main() {
    Patient p = Patient("jay",21);
    print(p.name);
    print(p.age);
    }

  • @BankITOfficer
    @BankITOfficer ปีที่แล้ว +2

    class Patient {
    String? name;
    int? age;
    String? disease;
    Patient(String name, int age, String disease) {
    this.name = name;
    this.age = age;
    this.disease = disease;
    }
    void display() {
    print("Name is $name");
    print("age is $age");
    print("Disease is $disease");
    }
    }
    void main(List args) {
    Patient patient = Patient("vikram", 33, "typhoid");
    patient.display();
    }

  • @StefenTjung
    @StefenTjung 2 หลายเดือนก่อน

    i dont understand why should we use constructor? i mean if you didnt put the constructor, i still works way the same right? just change the void display to
    void display (){
    print ("Name is $name");
    print ("Age is $age");
    }

  • @raghav042
    @raghav042 5 หลายเดือนก่อน

    Very helpful series ❤

  • @becborahm
    @becborahm ปีที่แล้ว

    🤔It's a bit difficult for me. I will watch all your video and come back to this video again. 😅😁 Thank you!!

    • @darttutorial
      @darttutorial  ปีที่แล้ว

      Sure see you...

    • @fabiano8888
      @fabiano8888 6 หลายเดือนก่อน

      Hi, Bec! Any improvements?

  • @viandaelendherlina5923
    @viandaelendherlina5923 2 ปีที่แล้ว

    thanks for your challengge

  • @MuhammadMohsinHussain-sz6no
    @MuhammadMohsinHussain-sz6no 7 หลายเดือนก่อน

    You are Awesome

  • @omarmoahmed9992
    @omarmoahmed9992 ปีที่แล้ว

    Thanks bro

  • @Achchabl6377
    @Achchabl6377 ปีที่แล้ว

    class Patient {
    String? name;
    int? age;
    String? disease;
    Patient(String name, int age, String disease) {
    this.name = name;
    this.age = age;
    this.disease = disease;
    }
    }
    void main() {
    Patient patient = Patient("Harry", 23, "flue");
    print(patient.name);
    print(patient.age);
    print(patient.disease);
    }

  • @khubaibirfan9215
    @khubaibirfan9215 2 ปีที่แล้ว

    ❤️❤️❤️💓💓❤️💓❤️

  • @Lui_Catarino
    @Lui_Catarino 5 หลายเดือนก่อน

    class Patient {
    String? name;
    int? age;
    String? disease;
    Patient(this.name, this.age, this.disease);

    void display(){
    print( 'Name: $name');
    print('Age: $age');
    print('Disease: $disease');
    }
    }
    void main(){
    Patient pacient= Patient('Lui', 19, 'Sobrepreso');
    pacient.display();
    }

  • @born2learn507
    @born2learn507 8 หลายเดือนก่อน

    class Patient {
    String? name;
    int? age;
    String? disease;
    //creating constructor
    Patient(n, a, d) {
    this.name = n;
    this.age = a;
    this.disease = d;
    }
    }
    void main() {
    Patient patient = Patient("Ram", 33, "Cancer");
    print(patient.name);
    print(patient.age);
    print(patient.disease);
    }

  • @zionof37
    @zionof37 12 วันที่ผ่านมา

    class Patient {
    String? name;
    int? age;
    String? disease;
    Patient(this.name, this.age,this.disease);
    void display(){
    print("The patient name is ${this.name}");
    print("The patient age is ${this.age}");
    print("The patient disease is ${this.disease}");
    }
    }
    void main() {
    Patient p = Patient("Abebe",30,"Ameba");
    p.display();
    }

  • @StefenTjung
    @StefenTjung 2 หลายเดือนก่อน

    Class Patient (){
    String? name;
    int? age;
    String? disease;
    Patient ({this.name, this.age,this.disease});
    void print (){
    print("Name: ${this.name} ;
    print("Name: ${this.age} ;
    print("Name: ${this.disease} ;
    }
    }
    void main () {
    Patient p1 = Person("Wooble", 10, "Stomatche")
    p1.display();
    }

  • @ibrahimcetin5034
    @ibrahimcetin5034 5 หลายเดือนก่อน

    patient.dart
    class Patient {
    String? name;
    int? age;
    String? illness;
    Patient({required this.name, required this.age, required this.illness}) {}
    void display() {
    print("patient name is ${this.name}");
    print("patient age is ${this.age}");
    print("patient illness is ${this.illness}");
    }
    }
    main.dart
    import 'patient.dart';
    void main() {
    Patient p1 = Patient(name: "Ibrahim", age: 21, illness: "grip");
    p1.display();
    }