2024年4月1日发(作者:)
第八章 判断题
1.用= =比较字符串对象时,如果字符串包含的是同一个值时,结果为true。( )
2.字符串在创建后可以被修改。( )
类的charAt方法返回字符穿串中字符的个数。( )
类的compareTo方法在所比较的字符串相等时返回0。( )
5.运算符“==”用于比较引用时,如果两个引用指向内存中同一个对象,则返回true。
( )
Buffer类的indexOf方法在字符串中定位某个字符或子串第一次出现的位置。
( )
类的substring方法拷贝并返回字符串对象的一部分。( )
类的replace方法只返回一个新的字符串对象。( )
类的valueOf方法由它的参数转换成的字符串。( )
Tokenizer类的hasMoreTokens方法确定在字符串中是否还有语言符号返
回。( )
第八章 选择题
1.下面语句书写错误的是:
A.String s = “Gone with the wind”;
String t = “good”;
String k = s + t;
B.String s = “Gone with the wind”;
String t;
t = s[3] + “one”;
C.String s = “Gone with the wind”;
String standard = rCase( );
D.String s = “home directory”;
String t = s - “directory”;
2.请看下面的代码
String s = “hello”;

发布评论