Kotlin Enum class (with Demo Source Code)

preview_player
Показать описание

Explore 'enum' in this kotlin tutorial.
- Why we use enum classes?
- What are default properties of 'ordinal' and 'name'?
- What are default methods of 'values()' and 'valueOf()'?
- Add more properties to enum constants.
- How to implement interface on Enum class?
- How to use enum constant objects as anonymous classes?

Timestamps:
00:00 Introduction
00:17 Create Enum Class
01:53 Enum properties: ordinal and name
03:23 Enum methods: values() and valueOf()
04:16 'when' statement
05:15 Using Contructors to add more properties
07:13 Implementing Interface
08:53 Anonymous Class by enum constants
09:20 Summary
10:30 Thank You!

.
.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)

Free Programming courses:

Free Flutter course:

Free Android courses:

More free programming courses:

Check out my website:

Let's get in touch! [Sriyank Siddhartha]

---- Thank you for your love and support ----
Рекомендации по теме
Комментарии
Автор

Comment to support. Thanks alot folks!

SriyankSiddhartha
Автор

*default comment to support*
Pd: thanks!!! It helped me a lot 😌😌

anonimz
Автор

Thanks for good explanation as usually, but you forgot to mention that all constants have to be separated from other members of enum class with - " ; " (semicolon)

maximkarassev
Автор

what is the solution of "Enum Constants as Anonymous Class
by using abstract methods" please explain.

ADITYARAJ-yvtr
Автор

Can we see ktor playlist in future? There are less videos available for ktor on youtube

ackerman
Автор

this is really helpful. thank you. i do have a question. do you know how to read and write enums to Firebase when the values in Firestore are strings, not integers?

DavidNitzscheBell
Автор

Please Make a video when we shoud use abstract class over interface & vice versa. Explain it with design pattern. I mean, when we are designing a project and that's time what we shoud keep in mind.

ibrahimkhalilshakir
Автор

I remember you doing Kotlin tutorials for beginners back in 2017, are you going to refresh all the topics again like you have done in the case of Enums?

MrSojek
Автор

Dear Sir,
You are a great teacher!!
Can you make a video on Alarm manager?
Everyday in a specific 5 times notification will show to user.and the time add by admin or programmatically in the code...How to solve this?
Please sir make a video on it .
Please help me with advice.For this what should I use..I tried 3 topic but can't work properly.I think that is my fault or don't know whats the problem.please help me sir...
1.Work Manager
2.Alarm manager
3.Firebase push notification
Which one should use..I used alarm manager.Am I in the right path?
I also tried with work manager.but it couldn't show specific time notification.

s.m.isratara
welcome to shbcf.ru