Skip to content

Instantly share code, notes, and snippets.

@mrnirva
Created September 22, 2020 16:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mrnirva/f5c339873e240bc3b2364553e261b5a4 to your computer and use it in GitHub Desktop.
package interfaces;
public class Arayuzler {
public static void main(String[] args) {
Kopekler kopek = new Kopekler();
kopek.yemekYe();
}
}
interface Hayvanlar{
void yemekYe();
}
interface Memeliler{
void ure();
}
// Görüldüğü üzere birden fazla interface
// implements ile alıp kullabildik
class Kopekler implements Hayvanlar,Memeliler{
@Override
public void yemekYe() {
System.out.println("Et Ye");
}
@Override
public void ure() {
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment