I am new java programmer (experienced with other languages), and I need a sample code snippet illustrating how to access variables in a public Method from a private Method both in the same Class. Defining the variables in the public Method at the Class level (making the variables accessible globally within the Class) return static values.
Example of variable assignments in public Method:
double RS = avgUp / avgDown;
double RSI = 100.0 - (100.0 / (1.0 + RS));
rsiseries.setDouble(index, Values.RSI, RSI);
Double rsiFastMA = rsiseries.sma(index, fastPath, Values.RSI);
Double rsiSlowMA = rsiseries.ema(index, slowPath, Values.RSI);
Need to access RSI, rsiFastMA and rsiSlowMA in the public Method from a private Method both in the same Class.
Any suggestions on how to accomplish this will be greatly appreciated.