forked from ZeroAccess/CompleteJavaDevelopersCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
26 lines (23 loc) · 731 Bytes
/
Main.java
File metadata and controls
26 lines (23 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package MethodOverloading;
/**
* Created by robertsg on 11/19/2015.
*/
public class Main {
public static void main(String[] args) {
calculateScore("Tim", 500);
calculateScore(750);
calculateScore();
}
public static int calculateScore(String playerName, int score) {
System.out.println("Player " + playerName + " , score was " + score);
return score * 1000;
}
public static int calculateScore(int score) {
System.out.println("Unknown Player " + " , score was " + score);
return score * 1000;
}
public static int calculateScore() {
System.out.println("Unknown Player and no score");
return -1;
}
}