![]() |
passing variables from one method to another?
:
public class something |
methodTwo doesn't have any variable types declared.
[PHP] //this works public class something { public void methodOne() { int i = 0; int x = 4; String word = "hello"; int[] abc = new int[26]; while( i < 26) { abc[i] = x; x++; i++; } methodTwo(i, x, word, abc); } public void methodTwo( int i, int x, String word, int abc[]) { int a = i; int b = x; String c = word; int d[] = abc; } } [/PHP] btw, please work at the issue before posting, these are common program errors and it shows us that you do not know what you are doing. I advise you to read up so references. |
yeah, thanks, I noticed.
I have been a little jumpy recently... |
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(){if I try to invoke it in another class, for instance: :
|
First of all, it doesn't work because printAbc() contains arguments and to me it looks like it doesnt have any arguments! And doesn't initAbc() call printtAbc automatically?
|
| All times are GMT -5. The time now is 7:56 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC