scjp考题
930. What String instance method would return true when invoked like this?
a.method(b);
Where a="GROUNDhog" and b="groundHOG"?
Select the one right answer.
A. equals()
B. toLowerCase()
C. toUpperCase()
D. equalsIgnoreCase()
E. none of the above
正确答案: D
931. At the end of these two lines of code:
String s="hypertext";
String t=s.substring(2,5);
What does the object reference t contain? Select the one right answer.
A. "yper"
B. "ype"
C. "pert"
D. "per"
E. "perte"
正确答案: D