Constructors in Kotlin | Primary & Secondary Constructors | CheezyCode #16

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 54

  • @scoopingmangoes
    @scoopingmangoes Год назад +6

    Just a suggestion
    Please use light theme with large font ..u can change font through settings of IDE. For mobile users its hard to zoom in every time. Thanks a lot for your initiative to introduce android development teaching thr YT

  • @KapilTapsi
    @KapilTapsi 4 года назад +7

    Wow, Sir returns. Guess its time to start Kotlin as well. Thank you in advance

  • @AdarshRebile-v9z
    @AdarshRebile-v9z Месяц назад

    Thanks a lot for your initiative to introduce android development teaching
    😇

  • @Infonation108
    @Infonation108 Год назад +6

    Now it is becoming more complex 🥲🥲

  • @coolbuddy2405
    @coolbuddy2405 3 года назад +2

    Very Good Explanation

  • @naimeimran3247
    @naimeimran3247 3 года назад +2

    Thanks Sir

  • @minalchhetri3878
    @minalchhetri3878 4 года назад +3

    good content sir...but in present which is better flutter with dart or android with java/kotlin for mobile app development?

    • @CheezyCode
      @CheezyCode  4 года назад +4

      Both have their own advantages. I have been trying flutter for a while now. Liking how quick it is. But native is native. So you have to decide.
      I will say don't restrict yourself. Learn both of them for now.

    • @minalchhetri3878
      @minalchhetri3878 4 года назад

      @@CheezyCode okay sir

    • @2kuu
      @2kuu 7 месяцев назад

      so hows it going so far?

    • @minalchhetri3878
      @minalchhetri3878 7 месяцев назад

      @@2kuu going nice. I have learned flutter too.

    • @2kuu
      @2kuu 7 месяцев назад

      @@minalchhetri3878 got any job/internship?

  • @jaydeepmalviay2582
    @jaydeepmalviay2582 9 месяцев назад +2

    One clarity...Whats the specific reason to call a primary constructor from any secondary constructor? unlike Java...any reason?

    • @AvengerGamingYT.
      @AvengerGamingYT. 6 месяцев назад

      as per i know when we create properties in constructor we cannot keep them empty in object, there are some properties which we want to keep empty. but if we have this condition we create secondary construtor. Eg we have to fill first name, last name, age and not middle name so we cannot keep those properties empty in object. val person = Person("Harry", ,"Jones",25 ).
      Here one property is empty which will cause error (two commas)
      .There is also method to put default values for properties

    • @AvengerGamingYT.
      @AvengerGamingYT. 6 месяцев назад

      this is the syntax of kotlin which helps in not creating constructor every time unlike java .
      they are created inside the primary constructor using constructor keyword

  • @TheAbhidugar
    @TheAbhidugar 3 года назад +1

    Thank-you

  • @Project-Icarus-101
    @Project-Icarus-101 2 года назад +1

    Sir what will be the difference between making a secondary constructor and sending default values for the class params?

    • @CheezyCode
      @CheezyCode  2 года назад +1

      Generally we want to have multiple constructors for a class. You want to provide different ways to create an object of a class. That is why we need secondary constructor.

    • @Project-Icarus-101
      @Project-Icarus-101 2 года назад

      @@CheezyCode ok Sir

  • @KuldeepRaoMaratha
    @KuldeepRaoMaratha 4 года назад +1

    Secondary constructor clear हो गया सर अब init block थोड़ा और समझा दीजिये plz and Thank you for awesome tutorial

    • @CheezyCode
      @CheezyCode  4 года назад +2

      Object creation pe kuch logic execute karna hai ya kuch set of lines execute karna h toh init block ka use karte h

  • @AmitSharma-ji5ud
    @AmitSharma-ji5ud 2 года назад +2

    Hello sir how to clear cache of recycler view loading products

  • @King_Slayer_06
    @King_Slayer_06 Год назад +1

    Is Init block called after the Constructor at the time of Object Creation?

    • @catlord777x3
      @catlord777x3 8 месяцев назад

      Primary Constructor: The primary constructor of the class is executed first, initializing any properties or performing any tasks defined in the constructor parameters.
      Init Blocks: After the primary constructor, the init blocks are executed in the order in which they appear in the class body. Multiple init blocks are executed in the order they are defined.
      Secondary Constructors: If there are any secondary constructors, they are executed after the init blocks.

  • @aim_talks
    @aim_talks Месяц назад

    Very 🎉nice

  • @arbazrehmansheikh3693
    @arbazrehmansheikh3693 4 года назад +2

    Are there no concept of private and public ?? as these class are very much similar to structure in c/c++.

    • @CheezyCode
      @CheezyCode  4 года назад +1

      Yes it has. Visibility modifiers - you can check that video in the playlist

    • @arbazrehmansheikh3693
      @arbazrehmansheikh3693 4 года назад

      @@CheezyCode Okay, Thanks buddy !

  • @abhimanyugoswami3462
    @abhimanyugoswami3462 4 года назад +2

    hello sir i am currently working on tiktok clone project , can i get any reference for video editor or have you ever worked on video editor then please share your experience.. i am waiting.

    • @CheezyCode
      @CheezyCode  4 года назад +3

      Never worked on editing of videos via Android. Had made some image editing apps.
      You can checkout ffmpeg for this. It has various things that you need to figure out. Try some open source on GitHub. You can take inspiration from that.

    • @muneebkhalid6332
      @muneebkhalid6332 Год назад

      send me link for tiktok project clone plzz

  • @GauravKawatrakir
    @GauravKawatrakir 4 года назад +2

    Parameters with class are constructors? @5:08

    • @CheezyCode
      @CheezyCode  4 года назад

      When you define parameters with class name they are part of primary constuctor

    • @GauravKawatrakir
      @GauravKawatrakir 4 года назад

      @@CheezyCode ok Thanks

  • @rameezkhan3641
    @rameezkhan3641 2 месяца назад

    difference in init block and constructors ?

    • @CheezyCode
      @CheezyCode  2 месяца назад

      To perform additional initialization logic that might not be directly handled by the constructor

    • @rameezkhan3641
      @rameezkhan3641 Месяц назад

      @@CheezyCode thanks bro

  • @saif_ali786-f5i
    @saif_ali786-f5i Год назад +1

    👍

  • @zahidnoor7070
    @zahidnoor7070 2 года назад +1

    sir m 10 bar ye vdo dekh chuka hu but mujhe ye topic smjh nhi aa rha bilkul bhi.... help me.. kli or vdo ho to plz btao..

    • @CheezyCode
      @CheezyCode  2 года назад +2

      Code karlo - print karo statements...har place pe jahan doubt hai...clear hojayega

    • @zahidnoor7070
      @zahidnoor7070 2 года назад

      @@CheezyCode sir android tutorial kotlin poori pdhne k bad start kru ya sath sath start krna chahiye?

    • @CheezyCode
      @CheezyCode  2 года назад +1

      Saath saath

  • @TechnicalAkshay
    @TechnicalAkshay 9 месяцев назад +1

    There are some things that u have not explained clearly aap mumbai nhy aa rahe he we are sorry

  • @ajaykotiyal427
    @ajaykotiyal427 3 месяца назад

    I think, Kotlin was developed only to degrade Java. init{} block was very unfair. How to perform constructor overloading then?
    Dart is much better than Kotlin.

  • @ebookfactory8566
    @ebookfactory8566 Год назад +1

    At the end, it’s hard 😢

  • @divyanshusah2809
    @divyanshusah2809 4 года назад +2

    SIR SIMPLE tarike se samjhau na sir itna kuyn comlicated karte ho......