TheGunslinger
2010-11-05 19:10:20 UTC
First off, FYI, I have a fully functional program that I would like to
change one aspect.
I have several NON-static variables in my Class.
int myObjectCounter;
double myObjectDollars;
int myObjectTransactions;
String myObjectNames;
double myObjectCurrency;
I need to use them in a static method:
public static void myObjectDisplay(){
System.out.println("my text" + myObjectNames + "\t" + myObjectDollars
+ "\t" + myObjectCurrency + "\t" + myObjectTransactions);
} //End myObjectDisplay()
I want to call it from main();
The instantiation is of type: Object Array...
So, I want to use a For-Loop as follows to display the results for
each array object.
for(int i=1;i<arrayLength;i++){
myCurrencyObject[i].myObjectDisplay();
}
Suggestions?
TIA,
MJR
change one aspect.
I have several NON-static variables in my Class.
int myObjectCounter;
double myObjectDollars;
int myObjectTransactions;
String myObjectNames;
double myObjectCurrency;
I need to use them in a static method:
public static void myObjectDisplay(){
System.out.println("my text" + myObjectNames + "\t" + myObjectDollars
+ "\t" + myObjectCurrency + "\t" + myObjectTransactions);
} //End myObjectDisplay()
I want to call it from main();
The instantiation is of type: Object Array...
So, I want to use a For-Loop as follows to display the results for
each array object.
for(int i=1;i<arrayLength;i++){
myCurrencyObject[i].myObjectDisplay();
}
Suggestions?
TIA,
MJR