Advertisement
Guest User

Televisi.java

a guest
Apr 23rd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. public class Televisi{
  2.     Boolean status = false;
  3.     public static int channel;
  4.     public Televisi(String a, String b){
  5.         String nama = a;
  6.         String harga = b; //Kenapa string ? karna dia memanggilnya begini (...,"3JUTA"). ada huruf
  7.         System.out.println("Televisi "+nama+" harga "+harga);
  8.     }
  9.     public hidupkanTv(){
  10.         Boolean status = true; //Hidup
  11.         System.out.println("Televisi hidup");
  12.     }
  13.     public setChannel(int a){
  14.         if(a instanceof int){
  15.             int channel = a;
  16.         }else{
  17.             System.out.println("Parameter channel harus tipe integer !");
  18.             System.exit(0);
  19.         }
  20.     }
  21.     public getChannel(){
  22.         return channel;
  23.     }
  24.     public matikanTv(){
  25.         Boolean status = false; //Mati
  26.         System.out.println("Televisi mati");
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement