Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Televisi{
- Boolean status = false;
- public static int channel;
- public Televisi(String a, String b){
- String nama = a;
- String harga = b; //Kenapa string ? karna dia memanggilnya begini (...,"3JUTA"). ada huruf
- System.out.println("Televisi "+nama+" harga "+harga);
- }
- public hidupkanTv(){
- Boolean status = true; //Hidup
- System.out.println("Televisi hidup");
- }
- public setChannel(int a){
- if(a instanceof int){
- int channel = a;
- }else{
- System.out.println("Parameter channel harus tipe integer !");
- System.exit(0);
- }
- }
- public getChannel(){
- return channel;
- }
- public matikanTv(){
- Boolean status = false; //Mati
- System.out.println("Televisi mati");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement