正在加载图片...
Determining the Size r We determine the number of characters in a String the length method String name =Sumatra str1 one/ str2= str3 namelength()i strl length()i 3 Error because no str2 length()i 0 object is created for str3. so it is a null str3 length()i Error C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 8-9© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 8 - 9 Determining the Size We determine the number of characters in a String with the length method. String name = “Sumatra”, str1 = “one”, str2 = “”, str3; Error because no object is created for str3, so it is a null. name.length( ); str1.length( ); str2.length( ); str3.length( ); 7 3 0 Error!
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有