Advertisement
thenewboston

Java Programming Tutorial - 32 - Arrays in Methods

Aug 22nd, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. class apples{
  2.    public static void main(String[] args){
  3.       int bucky[]={3,4,5,6,7};
  4.       change(bucky);
  5.  
  6.       for(int y:bucky)
  7.          System.out.println(y);
  8.       }
  9.  
  10.    public static void change(int x[]){
  11.       for(int counter=0;counter<x.length;counter++)
  12.          x[counter]+=5;
  13.    }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement