Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- int y = 3;
- foo(y);
- System.out.println(y);
- int[] tbl = new int[2];
- tbl[0] = 1;
- tbl[1] = 1;
- tblFooFirst(tbl);
- System.out.println(tbl[0]);
- System.out.println(tbl[1]);
- tblFooSecond(tbl);
- System.out.println(tbl[0]);
- System.out.println(tbl[1]);
- }
- static void foo(int x){
- x = 5;
- System.out.println(x);
- }
- static void tblFooFirst(int[] tbl){
- tbl = new int[2];
- tbl[0] = 5;
- tbl[1] = 5;
- }
- static void tblFooSecond(int[] tbl){
- tbl[0] = 10;
- tbl[1] = 10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement