Passing variable information between classes
This code works, I just want to know if the structure is good or bad?
I want to know your opinions on the best way to pass variable results
between classes.
If I write a class that calculates tax etc and I want to pass that result to another class to be used in an array or another calculation should I do it like this?
Code:
public class totalMe {
private static String word;
/**
* @param args
* @param word
*/
public static void main(String[] args) {
smallSum sm = new smallSum();
System.out.print(sm.TheWord(word));
}
}
class smallSum{
public String TheWord(String word){
word ="did it work?";
return word;
}
}
Thanks for your time ---
ZTG