trojanxem

Untitled

Dec 5th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1.  
  2. public class Ksiazki {
  3.     private int ile_stron;
  4.     private String nazwa;
  5.     private char autor;
  6.     private int cena;
  7.    
  8.     public int getile_stron(){
  9.         return ile_stron;
  10.     }
  11.     public void setile_stron(int i){
  12.         ile_stron = i;
  13.     }
  14.     public String getnazwa(){
  15.         return nazwa;
  16.     }
  17.     public void setnazwa(String n){
  18.         nazwa = new String(n);
  19.     }
  20.     public char getautor(){
  21.         return autor;
  22.     }
  23.     public void setautor(char a){
  24.         autor = a;
  25.     }
  26.     public int getcena(){
  27.         return cena;
  28.     }
  29.     public void setcena(int c){
  30.         cena = c;
  31.     }
  32.    
  33.    
  34.    
  35.  
  36. }
  37.  
  38.  
  39. public class Glowna {
  40.  
  41.     public static void main(String[] args) {
  42.         Ksiazki pierwsza = new Ksiazki();
  43.         Ksiazki druga = new Ksiazki();     
  44.         pierwsza.setnazwa(n);
  45.         pierwsza.setcena(30);
  46.         pierwsza.setile_stron(471);
  47.         druga.setcena(37);
  48.         druga.setile_stron(501);       
  49.  
  50.     }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment