stringTest.subSequence(0,6).toString();subSequence() returns CharSequence, while displayText returns String. So you need toString().import lang is not needed. lang package will be automatically imported.
调试欢乐多
In fact,you have answered my two questions.
But I don't know what type of the variables is this "CharSequence" in the follow sentence:
public CharSequence subSequence(int start,int end)Can you give me an example?
char charAt(int index);
int length();
CharSequence subSequence(int start, int end);
String toString();
}
Surpose
I don't use "String" this variable in Here:
public "String" displayText() //实现在接口中说明的方法displayText()
{
return stringTest.subSequence(0,6);
}what should I do to make it correct?