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.
Hi all. Working on a project for school and am almost done with my first draft, but have run into a seemingly simple problem. This method is supposed to return a string. I didn't initialize the string at the top of the method because I had nothing to initialize it to per se. I then run a loop to give the string some data and return the string with a little addendum. I am getting a compiler error because the string has not been initialized, and I realize that the scope of s is permitted only to the loop, but i thought if i declared the string outside the loop and then modify it inside the loop, the compiler can recognize that as the same variable. i don't declare a new variable inside the loop(!), so what gives?