andari3107

interface

Dec 19th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. interface pakaian {
  2.     public void bersih();
  3.     public void kotor();
  4. }
  5.  
  6. public class interfaces implements pakaian {
  7.     public void bersih() {
  8.         System.out.println("Pakaian itu bersih");
  9.     }
  10.     public void kotor() {
  11.         System.out.println("Pakaian itu kotor");
  12.     }
  13.     public static void main(String[] args) {
  14.         interfaces i = new interfaces();
  15.         i.bersih();
  16.         i.kotor();
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment