正在加载图片...
String is an object r String is a class in the java. lang package. Because String is a class we need to create an instance of String in Java for string processing like any other objects, we need a declaration and object creation for the instances of the String class. For example, String namely name1= new string(latte")i But we normally use a shorthand instead treating These two statements String objects much like primitive data. For example, are equivalent String ameli name1= latte C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 8-7© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 8 - 7 String is an Object String is a class in the java.lang package. Because String is a class, we need to create an instance of String in Java for string processing. Like any other objects, we need a declaration and object creation for the instances of the String class. For example, String name1; name1 = new String( “Latte” ); But we normally use a shorthand, instead, treating String objects much like primitive data. For example, String name1; name1 = “Latte”; These two statements are equivalent
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有