Question: In java I don't understand why didn't the return give a 500,000 value output as the first line since the code typed by my professor

In java I don't understand why didn't the return give a 500,000 value output as the first line since the code typed by my professor said return score * 1000? Instead it said 500 points?

Here's the code:

public static void main(String[] args) { int newScore = calculateScore ("Tim", 500); System.out.println("New Score is" + newScore); } public static int calculateScore(String playerName, int score) { System.out.println("Player" + playerName + "scored" + score + "points"); return score * 1000; }

Here's the output:

// Line 1

Player Tim scored 500 points

// Line 2

New score is 500000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!