daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class zad4{
  2.     public static void main(String[] args){
  3.         TV tv = new TV("TVP1");
  4.         tv.zmienProgram();
  5.     }
  6. }
  7.  
  8. class Odbiornik{
  9.     private String nazwa;
  10.     private int nrProgramu;
  11.     private String[] listaProgramow = new String[100];
  12.    
  13.     public Odbiornik(String nazwa){
  14.         this.nazwa=nazwa;
  15.     }
  16.    
  17.     public void ustawNrProgramu(int nrProgramu){
  18.         this.nrProgramu=nrProgramu;
  19.     }
  20.    
  21.     public void zmienProgram(){
  22.         this.nrProgramu = (int)(Math.random()*101);
  23.         System.out.println("Program nr:"+nrProgramu);
  24.     }
  25. }
  26.  
  27. class Radio extends Odbiornik{
  28.     public Radio(String nazwa){
  29.         super(nazwa);
  30.     }
  31. }
  32.  
  33. class TV extends Odbiornik{
  34.     public TV(String nazwa){
  35.         super(nazwa);
  36.     }
  37.    
  38.     public void rozjasnij(){
  39.         System.out.println("rozjasnij");
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top