You are not logged in.

#1 2015-06-16 06:03:41

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Constructors-And-Methods:

Java Quizzes Java Language Constructors-And-Methods

Directions:
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";
      }
}

Question:
What will be the output?

Option A):
abc 
Option B):
xyz
Option C):
Compilation clean but no output
Option D):
Compilation fails

Correct Answer is Option A):
abc


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-16 06:03:41

Advertisement
Ads By Google

Re: Constructors-And-Methods:



\n

Board footer