设有定义:String s=“World”;,下列语句错误的是()。
A:int m=s.indexOf(‘r’);
B:char c=s.charAt(0);
C:int n=s.length();
D:String str=s.append(‘2’);
出自:计算机科学