1

Consider the two methods (within the same class)
public static int foo(int a, String s)
{
s = “Yellow”;
a=a+2;
return a;
}
public static void bar( )
{
int a=3;
String s = “Blue”; a = foo(a,s);
System.out.println(“a=”+a+” s=”+s);
}
public static void main(String args[])
{
bar( );
}
What will be printed on execution of these methods?

  • A

    a = 3 s = Blue

  • B

    a = 5 s = Yellow

  • C

    a = 3 s = Yellow

  • D

    a = 5 s = Blue