java after reading text from file, prints will “null” in the beginning

前端 未结 4 932
北海茫月
北海茫月 2021-01-21 09:11

I\'ve readed from the .txt file this:





        
4条回答
  •  囚心锁ツ
    2021-01-21 09:43

    do this private static String str = "";. By default, your str variable is null so while concatenating null is used.

    Initialize it to a blank string as I've shown.

提交回复
热议问题