MCQ Single Best Answer Not Set

QWhat will be the output?
public class Test{
      public static void main(String[] args){
            String value = "abc";
            changeValue(value);
            System.out.println(value);
      }

      public static void changeValue(String a){
            a = "xyz";
      }
}

ID: #2190 Java Constructor and Methods 604 views
Question Info
#2190Q ID
Not SetDifficulty
Java Constructor and MethodsTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A abc
  • B xyz
  • C Compilation fails
  • D Compilation clean but no output
Correct Answer: Option A

Explanation

abc

Share This Question

Challenge a friend or share with your study group.