please replace this String s[]={"A","B"} with StringBuffer[] s={"A","B"}; sorry i posted the wrong one which is irrelevant to my question. now you check with this...
Arun you can intialize String array with the syntax
String[] arr = {"a", "b"};
because this is just a shortcut provided to you by the compiler (just like autoboxing etc) to make String class feel like a primitive type. But this shortcut is not applicable to any other type. So when you write this
StringBuffer[] arr = {"a","b"};
compiler changes the right hand part of the = operator and makes it new String[]{"a", "b"} so you get the inconvertible error message as String and StringBuffer classes are not related to each other...