ArrayTest3.java



public class ArrayTest3 {

    public static void main( String[] args ) {

        int[] b = doubleNumbers();
        for( int i=0; i<b.length; i++ ) {
            System.out.println( (i+1) + "*2=" + b[i] );
        }
    }

    public static int[] doubleNumbers() {

        int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        for( int i=0; i<a.length; i++ ) {
            a[i]*=2;
        }
        return a;
    }
}