It depends, if you defined that String inside that method, it's lost after the method ends. However, if the method returns that String, then you could call that String by

TheOtherClass toc = new...