Question Info

This question is public and is used in 13 tests or worksheets.

Type: Multiple-Choice
Category: Java and JSP
Level: Continuing Education
Score: 1
Author: BacMan
Last Modified: 2 months ago

View all questions by BacMan.

View Question

View this question.

Add this question to a group or test by clicking the appropriate button below.

Continuing Education :: Java and JSP by BacMan
What is the output of the following program?

public class ChangeMe {

    private static void changeMe(String s) {
        s = new String("Blue");
    }

    public static void main(String args[]) {
        String color = new String("Red");
        changeMe(color);
        System.out.println(color);
    }
}
  1. Red
  2. Blue
You need to have at least 5 reputation to vote a question down. Learn How To Earn Badges.