When you pass the String word to your hanging() method, the local word object in the method starts out as a reference to the object passed in from main(). However, when you set word = newWord, the local word variable is updated to point to a new object (same as newWord. The original String word (passed from main()) is not updated.
Since your methods are all static you could have a static variable word that is updated. Or the new word could be returned from hanging()
return newWord;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…