开发者

StringBuffer , StringBuidler

StringBuidler sb="ram" StringBuffer sf = "ram"

Both throws comile ti开发者_开发问答me error . Please explain Why??????


There's no promotion from String to StringBuilder/Buffer. Try

StringBuilder = new StringBuilder("ram")


Because StringBuilder and StringBuffer isn't strings. You need to write

sb = new StringBuilder("ram")


Perhaps because it is "StringBuilder" not "StringBuidler"?
Or maybe because you need a semi-colon between the two lines?
Or that "ram" is a string and not a StringBuilder or StringBuffer?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜