Kotlin Generics Explained with Example
Вставка
- Опубліковано 23 лип 2024
- In this video "Kotlin Generics Explained" we will learn about generics in Kotlin. Generic is a powerful feature of any object oriented programming and using it we can define classes or functions that can work with different data types.
0:00 Introduction?
0:20 Kotlin Generics, Why?
4:20 Kotlin Generics Explained
7:38 Generic Function
8:42 Multiple Typed Parameters
If you are having difficulties navigating from one lesson to another, then click on this link and it will open the complete playlist of this Kotlin Object Oriented Programming. In this playlist all lessons are already arranged in chronological order.
👉 bit.ly/3lMLtpj
All the codes about this Kotlin Android Tutorial for Beginners are organized sequentially in this repository
👉 bit.ly/2UoyiQf
And if you need more support, then you can join the Simplified Coding’s Quora Space to post your questions.
👉 www.quora.com/q/simplifiedcoding
If you want to get in touch with me; you can find my contact details here:
👉 www.simplifiedcoding.net/about/
Finally, If you love my content please SHARE my courses to your friends. You can share this course to your Facebook, WhatsApp etc.
For more contents related to Software Development visit my website.
👉 www.simplifiedcoding.net
You can SUPPORT me if you want
👉 Patreon: / belalkhan
👉 UPI (India Only): probelalkhan@okaxis
👉 PayTM (India Only): +917549161079
👉 PayPal: www.paypal.me/probelalkhan
You can also check some of my other courses from these links
👉 Android MVVM Tutorial: bit.ly/3iLfVzu
👉 Android Game Development Tutorial: bit.ly/38JmltC
👉 Retrofit Android Tutorial: bit.ly/2DEwAl1
👉 Android RecyclerView Tutorial: bit.ly/2TqVjPz
👉 Android Room Tutorial: bit.ly/2PfQHeN
👉 Firebase Auth Tutorial: bit.ly/2WUGhEo
👉 Android Notification Tutorial: bit.ly/2Sc6jQl
👉 Building a Complete Wallpaper App: bit.ly/30UN8zV
👉 Build Tic Tac Toe in Android: bit.ly/30goxW0
❤️❤️ Thank You All for the Love and Support ❤️❤️
#KotlinOOP
#OOPsConcept
#LearnKotlin - Наука та технологія
For the first time, I really understand generics. Thanks a lot
What a great teacher! keep up the good work, thanks a lot man!
Thanks Belal for the kotlin tutorial series 😃🙏
You are a brilliant teacher Bilal. Thanks to you now I understand generics.
I couldn't understand this concept even after going through the docs. Thank you for this simplified version.
Add a video on covariance, contrravariance, invariant.
very good feature of kotlin. Thanks for the info,
Thank you so much! Your vidios are so useful for me (and for other I guess). You made my coding live more better, I mean it! With love from Russian 💪👍
Thanx man this was very helpful 😊
wow great explanation with example!!! 😍
Loved it!
Great video, do you have a video on usage of covariance and contravariance?
I don't know how to tell you my gratitude but, I love you sir, thank you
As in java for we compair int value using == like 1==1 but for string we compair using equals() like str1.equals(str2) so in kotlin for string == work
Thank you master
How to upload .db file (Of SQLite Database) to user's Google Drive?, in Kotlin?
How can we achieve the same using pojo class as T ?
good explanations!
I like ur style!
Thank you
good examples
Are generics for beginners intermediate or pros? Because this seems like a difficult concept to grasp for me :(
When to use & when only
In very simple words
When you make your T out you can only define it as return type in function if you try to write it as a parameter you will get error.
For more details you can search
Covariance, Invariance and Contravariance
@@SimplifiedCoding thanks
Can we use Any instead T ?
Because Any is the class which is extended by all classes in default?
When you write T or any character; it basically means any. Here you cannot define the actual type not even any.
Any is there by default. It means T : Any that is you can define any type that inherits Any and Any is the super type of all classes.
You can also restrict by defining a specific parent for example T : View
It means here for T we can define any type that is a View.
So you cannot write the class name here. But you can define a super type if required.
@@SimplifiedCoding Thank you Belal
Covariance and Contravariance what about this?
nice manh
360p ? : ( too blurry
UA-cam is processing the HD version, wait for a while, it will become Full HD.
Is it helpful