Facebook
From Bistre Tern, 8 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 304
  1. package cwiczenie172;
  2.  
  3.  
  4. public class Punkt {
  5.     int x;
  6.     int y;
  7.     void putintotab(){
  8.     int[] tab = new int[2];
  9.     tab[0]= x;
  10.     tab[1]=y;
  11.     }
  12.     void ustawX(int wstX){
  13.         x = wstX;
  14.     }
  15.     void ustawY(int wstY){
  16.         y = wstY;
  17.     }
  18.   }
  19.  
  20.   package cwiczenie172;
  21.  
  22.  
  23. public class Cwiczenie172 {
  24.  
  25.    
  26.     public static void main(String[] args) {
  27.         Punkt punkt = new Punkt();
  28.         punkt.ustawX(1);
  29.         punkt.ustawY(2);
  30.       System.out.println(punkt.tab[0] + " " + punkt.tab[1]);
  31.        
  32.     }
  33.    
  34. }
  35.