Choose the correct two solutions.
public class
Test {
public static void main(
String args[])
{
StringBuffer str1="Hello";
StringBuffer str2=" there";
StringBuffer str3=str1+str2;
System.out.println(str3);
}
}
StringBuffer variables cannot be initialized in this fashion
Compiles & Prints "Hello there"
'+' operator cannot be used for StringBuffer variables.
Compiler converts StringBuffer variables to Strings & performs
initialization & concatenation.
I answered 1st and the 3rd options, but the 2nd option is said to be correct?
can somebody tell me y?