全面理解Java中的String數據類型

  1. 首先String不屬於8種基本數據類型,String是一個對象。   由於對象的默認值是null,因此String的默認值也是null;但它又是一種特殊的對象,有其它對象沒有的一些特性。   2. new String()和new String(「」)都是申明一個新的空字符串,是空串不是null;   3. String str=」kvill」; String str=new Strin
相關文章
相關標籤/搜索