Hi Folks,
I have a confusion over the declaration of
String & StringBuffer literals.
Statement 1: String s = "its a new string";
Statement 2: StringBuffer s = "Its a new string buffer";
Why , the 2nd statement gives compilation error?. But if I replace the statement with:
StringBuffer s = new StringBuffer("its a new string buffer");
it does not give compilation error.
Could anybody please throw some light on it.
much appreciated,
thanks
Suresh