java CharSequence接口
1)CharSequence接口重新定义了toString()方法,这就要求实现类必须重写object中的toString()方法
String toString()Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence. Overrides: toString in class Object Returns: a string consisting of exactly this sequence of characters
我们在实现时,如果定义接口时,我们对Object类中的一些方法不满意是,可以在接口中要求子类重写。
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步