therrontelford

Passing values

Jan 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class PassingValues {
  2.  
  3.     public static void main(String[] args) {
  4.         int x=10;
  5.         int[] bank = {8,6,7,5,5};
  6.        
  7.         passingValuesOrArrays(x, bank);
  8.         /*System.out.println(x);
  9.            
  10.         for (int e: bank)
  11.             System.out.print(e+ " ");
  12.         */
  13.        
  14.        
  15.     }
  16.     public static void passingValuesOrArrays(int x, int[] array){
  17.         x=12;
  18.         array[2]=9999;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment