Kotlin Getters and Setters

Поділитися
Вставка
  • Опубліковано 1 гру 2024

КОМЕНТАРІ • 26

  • @mohdotnet
    @mohdotnet 2 роки тому +1

    Thank you for taking the Time in making such an amazing video series. You explain and teach well. Many thanks Shukriyah

  • @radbaver
    @radbaver 3 роки тому +2

    Amazing video! Thank you so much 😃 You really explain the details 👍🏻

  • @mynameisearlb
    @mynameisearlb Рік тому

    Thank you for this video! I've been trying to understand these for a very long time but nobody really focuses on the keywords like you did

  • @orangasli2943
    @orangasli2943 Рік тому

    I want my class's attribute to be iterable..
    Right now the default implementation
    by kotlin is a flat assignment how do I do that

  • @HafizurRahman-u3d
    @HafizurRahman-u3d Рік тому

    Why we need to initialize the var explicitly while using get method?

  • @technoallMz
    @technoallMz 4 роки тому +3

    can we use
    val volume = length * width * height
    Instead of
    val volume
    get() = length.....
    ????

    • @SimplifiedCoding
      @SimplifiedCoding  4 роки тому +8

      Yeah you can do it as well but it will be an assignment and even after changing the value of width height volume will be the same that was calculated and assigned initially.
      But in case of getter it will calculate the volume everytime you will access the volume. So you will get correct volume even after changing width height.

    • @technoallMz
      @technoallMz 4 роки тому

      @@SimplifiedCoding thanks, you are great teacher.

  • @raiarauju
    @raiarauju 2 роки тому

    thank you for sharing your knowledge

  • @mkc0321
    @mkc0321 3 роки тому +2

    very good video

  • @tortoiseshell_cat
    @tortoiseshell_cat 4 роки тому +5

    If i have a function in data class witch return a
    private const BASE_IMAGE_URL ="https:/..."
    data class Product(
    val imageUrl :String
    )
    {
    fun fullImageUrl() =BASE_IMAGE_URL + imageUrl
    }
    can i change it with getter
    Like
    get =BASE_IMAGE_URL+ imageUrl
    And sir last think do u have video about authenticator (okhttp)
    And thank u so much

    • @SimplifiedCoding
      @SimplifiedCoding  4 роки тому +2

      Yes you can do it ofcourse.
      Not yet but I will make a video about authenticator soon.

    • @tortoiseshell_cat
      @tortoiseshell_cat 4 роки тому

      @@SimplifiedCoding thank u 🧡

  • @Snehal7862
    @Snehal7862 4 роки тому +2

    I want to learn android but how to start?
    I have basic knowledge about it
    So please guide me android or kotlin?

    • @SimplifiedCoding
      @SimplifiedCoding  4 роки тому +1

      Kotlin ofcourse

    • @Snehal7862
      @Snehal7862 4 роки тому +1

      @@SimplifiedCoding kotlin basics available in ur playlist?

    • @SimplifiedCoding
      @SimplifiedCoding  4 роки тому +1

      Yes, this video is itself the part of basics playlist.

    • @Snehal7862
      @Snehal7862 4 роки тому

      Ok thank u.
      If any query i will msg u

  • @footballCartoon91
    @footballCartoon91 2 роки тому +1

    why is that property is public? no need setter and getter

    • @אהלןסהלן
      @אהלןסהלן 7 місяців тому +1

      Setter and getter implementation seems to be the same as property, don't know how good it will be for incapsulation...

  • @jishnupdileep3143
    @jishnupdileep3143 2 роки тому

    👏🏻👏🏻 nice video

  • @moaly4738
    @moaly4738 Рік тому

    THX A LOT !!

  • @digitaleducationcenter3973
    @digitaleducationcenter3973 4 роки тому +3

    Sir please make a e-commerce app with make api plz sir

  • @Kepler57
    @Kepler57 2 роки тому +1

    Super

  • @kensyjolicoeur
    @kensyjolicoeur 3 роки тому +2

    watching a speed 1.75