Java interface 🦅

preview_player
Показать описание
Java interface interfaces tutorial explained example

#Java #interface #tutorial
Рекомендации по теме
Комментарии
Автор


public class Main {

public static void main(String[] args) {

Fish fish = new Fish();

fish.hunt();
fish.flee();

}
}

public interface Prey {

void flee();
}

public interface Predator {

void hunt();
}

public class Rabbit implements Prey{


@Override
public void flee() {
System.out.println("*The rabbit is fleeing*");

}
}

public class Hawk implements Predator{


@Override
public void hunt() {
System.out.println("*The hawk is hunting*");

}
}

public class Fish implements Prey, Predator{


@Override
public void hunt() {
System.out.println("*The fish is hunting*");

}

@Override
public void flee() {
System.out.println("*The fish is fleeing*");

}
}

BroCodez
Автор

Every time you have not understood something at university, our bro is there for us!

janmail
Автор

i spent last few hours trying to understand what interface is an it took you less than 8 mins to explain it perfectly.. you're awesome

osiaosienka
Автор

I absolutely love this guy's teaching style. I especially love that he has pseudo-code up so we know exactly what we are working with.

youvegotmail
Автор

Nice, understanding the relationship between predator and prey brought another layer of clarity. I have been existing without interfaces.

thegreenroom
Автор

It is really understandable and he is telling clearly, thank you bro

hgatl
Автор

Very thorough and professional! This guy created the classes and interfaces thren wrote the code right there, whereass our Uni professor copies the code from existing projects and files and pastes it without going through all of the steps with explainations.

Iwearcute
Автор

I am from Germany but it is the first clear english description which I understand and it is better as the other german description about Interfaces .. thumbs up for you and I will check your other videos, if I will learn more about Java .. thank you

bratan_rust
Автор

This is really helpful, thank you for helping me to understand JAVA better ^^ Keep up the great work!!

peiko
Автор

Thanks for the explanation 👍super easy to understand

Garrison
Автор

i love the way you simplify subjects, keep it up bro

hesham
Автор

Bro, you got the best tutorials! hopefully to see an AWS tutorial

ramziosta
Автор

simple, clean, understandable, thanks thumbs up

Andboldquates
Автор

For anyone without a Java IDE, to create a new interface, just make a new java file and put 'public interface <name>' and its the same thing.

faris.m
Автор

Lovely explanation, straight to the point!

abdulsamadh
Автор

Wow. Easy to follow and understandable. Thanks.

anmjubaer
Автор

So much simpler to understand than whatever I was learning. And I can already see how this is useful in more advanced applications

chilledxaura
Автор

Big thanks, teacher took 2 hours to try to explain this but you made it understandable.

nahimgood
Автор

Thanks, for this video it has helped me to understand more about interfaces and also learn about what I missed in class today 😊🥰

PhillyGodschild
Автор

Thanks, I always look at your videos, they are very easy to understand

albertoam