Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ContohAbstractInterface;
- interface PowerRangers{
- public void henshin();
- public void fusion();
- }
- interface Pertarungan{
- public void menang();
- public void kalah();
- }
- class rangers implements PowerRangers, Pertarungan{
- @Override
- public void henshin() {
- System.out.println("Berubah Menjadi Power Rangers");
- }
- @Override
- public void fusion() {
- System.out.println("Bergabung Menjadi Robot Gorila");
- }
- @Override
- public void menang() {
- System.out.println("Rangers Menang");
- }
- @Override
- public void kalah() {
- System.out.println("Rangers Kalah");
- }
- }
- class InterfaceAnjay {
- public static void main(String[] args) {
- rangers red = new rangers();
- red.henshin();red.fusion();red.kalah();
- }
- }
Add Comment
Please, Sign In to add comment