Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. public static void main (String[] args)
  2.     {
  3.         Integer duzyInt = 1;
  4.         Integer[] tablicaIntow = new Integer[5];
  5.        
  6.         for(int i = 0; i < tablicaIntow.length; i++){
  7.             tablicaIntow[i] = 1;
  8.         }
  9.        
  10.         for(Integer integer : tablicaIntow){
  11.             System.out.println(integer);
  12.         }
  13.        
  14.         metodaModyfikujacaDuzyInt(duzyInt);
  15.         metodaModyfikujacaTablice(tablicaIntow);
  16.         System.out.println("Int nietablicowy =" + duzyInt);
  17.         for(Integer integer : tablicaIntow){
  18.             System.out.println(integer);
  19.         }
  20.        
  21.        
  22.     }
  23.    
  24.     private static void metodaModyfikujacaDuzyInt(Integer duzyInt){
  25.         System.out.println("Hej wlasnie modyfikuje duzyInt");
  26.         duzyInt = 5;
  27.     }
  28.    
  29.     private static void metodaModyfikujacaTablice(Integer[] tablica){
  30.         for(int i = 0; i < tablica.length; i++){
  31.             tablica[i] = 2;
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement