Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (String[] args)
- {
- Integer duzyInt = 1;
- Integer[] tablicaIntow = new Integer[5];
- for(int i = 0; i < tablicaIntow.length; i++){
- tablicaIntow[i] = 1;
- }
- for(Integer integer : tablicaIntow){
- System.out.println(integer);
- }
- metodaModyfikujacaDuzyInt(duzyInt);
- metodaModyfikujacaTablice(tablicaIntow);
- System.out.println("Int nietablicowy =" + duzyInt);
- for(Integer integer : tablicaIntow){
- System.out.println(integer);
- }
- }
- private static void metodaModyfikujacaDuzyInt(Integer duzyInt){
- System.out.println("Hej wlasnie modyfikuje duzyInt");
- duzyInt = 5;
- }
- private static void metodaModyfikujacaTablice(Integer[] tablica){
- for(int i = 0; i < tablica.length; i++){
- tablica[i] = 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement