Difference between null and empty (“”) Java String

前端 未结 22 1458
再見小時候
再見小時候 2020-11-22 17:10

What is the difference between null and the \"\" (empty string)?

I have written some simple code:

String a = \"\";
String b         


        
22条回答
  •  名媛妹妹
    2020-11-22 17:50

    You may also understand the difference between null and an empty string this way:

    Original image by R. Sato (@raysato)

提交回复
热议问题