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

Short Answer
Views 18

Answer:


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

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.