CharSequence []和String []之间有什么区别? [英] What is the difference between CharSequence[] and a String[]?

查看:107
本文介绍了CharSequence []和String []之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CharSequence [] String [] 之间有什么区别?

推荐答案

字符串实现 CharSequence 界面。 CharSequence由String实现,但也有CharBuffer,Segment,StringBuffer,StringBuilder。

String implements the CharSequence interface. CharSequence is implemented by String, but also CharBuffer, Segment, StringBuffer, StringBuilder.

所以String []和CharSequence []基本相同。但是CharSequence是抽象,String是实现。

So a String[] and a CharSequence[] is essentially the same. But CharSequence is the abstraction, and String is the implementation.

顺便说一下,'[]'表示对象的数组。所以 String [] 是一个字符串数组。而String本身就是一个字符数组。

By the way, '[]' denotes an array of objects. So String[] is an array of strings. And String itself is an array of characters.

这篇关于CharSequence []和String []之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆