✏️ Explanatory Question

What is the output of the following code fragment if "abc" is passed as argument to the func( ) ?

👁 27 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation


public static void func(String s1)
{
    String s = s1 + "xyz";
    System.out.println("s1 = " + s1);
    System.out.println("s = " + s);
}

Output:


s1 = abc
s = abcxyz