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?
精彩评论