This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My main method calls a method no1, which is calling a method no2 three times in a row. Now I wish that method2 would return either value x or value y (depending on some if-else results) to method1, so that method1 continues calling method no2 with that newly changed value. But method no1 stubbornly calculates in all three calls with the value it got from the main method no matter what the return value was from method no2. My question: how can I "convince" method no1 to accept the return value of method no2 and forget about the given value in the main method? thank you for your patience of answering this (probably very green) question..
Hey Juliane, without seeing code its a little hard to make a definite determination. But it sounds as if you have the variable being set with the first method each time it is called. You might want to try looking at the scope of the variable within the first method.