Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class HelloWorld
  2. {
  3.  
  4.   public static void main(String[] args)
  5.   {
  6.     Blub blub = new Blub();
  7.     blub.x = 8;
  8.     yolo(blub);
  9.     System.out.println(blub.x);
  10.     bar(blub);
  11.     System.out.println(blub.x);
  12.   }
  13.  
  14.   private static void yolo(Blub blub){
  15.       blub = new Blub();
  16.       System.out.println(blub.x);
  17.   }
  18.  
  19.   private static void bar(Blub blub){
  20.       blub.x = 1337;
  21.   }
  22.  
  23. }
  24.  
  25. class Blub
  26. {
  27.     public int x = 42;  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement