class lal
{
public void fit(StringBuffer l)
{
String g=l+"nitin";
System.out.println(g);
}
public static void main(String[]args)
{
lal l=new lal();
StringBuffer b=new StringBuffer("funkid");
l.fit(b);
System.out.println(b);
}
}
The output in is
1)funkidnitin
2)funkid.
i want's to confirm onething, how does the (funkidnitin)is coming.My thinking say's when i use the + operator in line number 5, string literal convert's the whole experesion in string because string literal "nitin" create's an object which call's the default version of the toString() method of the string clas.Please correct me if i am wrong.