Kotlin INTERFACE example. Kotlin object-oriented programming for beginners #8.9

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

Kotlin android tutorial for beginners. Learn about Interface in Kotlin. How methods, variables are defined inside Interface and how to implement single and multiple Interface in a class. And how to deal with if there is a conflict of Interface.

.
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 ----
Рекомендации по теме
Комментарии
Автор

I just dropped the plan to learn kotlin because lack of some good resources but when i found your tutorials i am again putting my hands on it. Awesome experience in your tutorials.

rameshpithiya
Автор

Awesome and very clear explanation! Thank you! The only thing you skipped is talk about why Kotlin (as opposed to Java) only allows a single abstract method in an interface. Still looking for that explanation...

thomasbartke
Автор

This guy knows how to irrigate his community of developer herds with knowledge. Highly recommend for new pie and experienced java developers. Kotlin is more fun than java.

ashwyllsolutions
Автор

If one class can inherit 2 interfaces, and solve the diamond problem by calling super<interface1/2>.commonMethod(), why not a class can inherit 2 normal or abstract classes and solve the diamond problem with the same solution?

vladopris
Автор

What an awesome explain!!!
#Respect the lecturer

bunthaideng
Автор

Thank you, and I will dream about the word "simply" for a year now. I may never recover after this.

Effectivebasketball
Автор

Wow !!!! excellent explanations .Thank you sir :)

sumandas
Автор

Thanks for the tutorial, very easy to follow.

saurabhprakash
Автор

In java it's allowed to create instance of the interface why it's not the same to java?

blackballization
Автор

amazing vedio i really liked it, great job sir

viditchawda
Автор

Good job, but I think each property in interface is open if u initialize it but when u create it without initialization it will be abstract by default. But when I practice I found that interface can’t hold any initialized value but it can hold function with body I don’t know why. So if u know why I’ll appreciate your explain. :)

engmohamed
Автор

I like how he says "This compiler is not happy" whenever the compiler throws an error lol

abdulwahabhassan
Автор

Hi,
I'm new in kotlin.
I get confused about "Interfaces in Kotlin can contain declarations of abstract methods, as well as method implementations. What makes them different from abstract classes is that interfaces cannot store state"
What does that means? what is different between method with body in interface and abstract class?


Thank you for such a great video

freecountdummy
Автор

so what is the difference between abstract class and interface?

GameCrawl
Автор

How to take refernece of interface in variable

krishnacreation
Автор

Hi Sriyank i have query, if we have two interface with same abstract method when we implement these two interface than override that method is going well but when i run app its showing error( Exception in thread "main" kotlin.NotImplementedError: An operation is not implemented: Not yet implemented )

tadiyal
Автор

fun main(args:Array<String>)
{
var v = MyClass()
v.playButton()
v.stopButton()
}
interface FirstInterface
{
fun playButton()
fun stopButton(){
println("First Interface Player Stopped")
}
}
interface SecondInterface
{
fun playButton()
fun stopButton(){
println("Second Interface Player Stopped")
}
}
class MyClass : FirstInterface, SecondInterface
{
override fun playButton() {
TODO("Not yet implemented")
}
override fun stopButton() {


println("Normal Interface Player Stopped")
}
}

tadiyal
Автор

Does super keyword is used only in overriding method?

prashantmehta
Автор

Is there an equivalent code for in Java?

keystomusic
Автор

Thanks for the tutorial, very easy to follow.

iJuce
welcome to shbcf.ru