View Single Post
Old May 28th, 2006, 8:24 AM   #4
tumbleTetris
Programmer
 
Join Date: May 2006
Posts: 39
Rep Power: 0 tumbleTetris is on a distinguished road
well I just have hit another stumbling block, I can't invoke a method that has a passed array within its argument.

like if I have:
    public void initAbc(){
        String[] abc = new String[7];
        //destinations within array
        abc[0] = "[1]   fasd";
        abc[1] = "[2]   fdas";
        abc[2] = "[3]   dfafsd";
        abc[3] = "[4]   Hedfrmes";
        abc[4] = "[5]   dfas";
        abc[5] = "[6]   dfas";
        abc[6] = "[7]   asdfasfds";
        
        printDestinations( abc );
    }
    
    public void printAbc( String abc[] )
    {
        int i = 0;
        while ( i < 7 )
        {
            System.out.println(abc[i]);
            i++;
        }
    }

if I try to invoke it in another class, for instance:

classSomething abc = new classSomething();

abc.initAbc();

abc.printAbc(); <-- doesn't work.
tumbleTetris is offline   Reply With Quote