| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | */ | |
| 8 | 8 | public class CoffeeMakingTask extends Task { | |
| 9 | 9 | ||
| 10 | - private static int TIME_PER_CUP = 300; | ||
| 10 | + private static final int TIME_PER_CUP = 300; | ||
| 11 | 11 | ||
| 12 | 12 | public CoffeeMakingTask(int numCups) { | |
| 13 | 13 | super(numCups * TIME_PER_CUP); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | */ | |
| 8 | 8 | public class PotatoPeelingTask extends Task { | |
| 9 | 9 | ||
| 10 | - private static int TIME_PER_POTATO = 500; | ||
| 10 | + private static final int TIME_PER_POTATO = 500; | ||
| 11 | 11 | ||
| 12 | 12 | public PotatoPeelingTask(int numPotatoes) { | |
| 13 | 13 | super(numPotatoes * TIME_PER_POTATO); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,10 +9,10 @@ public abstract class Task { | |||
| 9 | 9 | ||
| 10 | 10 | private static int nextId = 1; | |
| 11 | 11 | ||
| 12 | - private int id; | ||
| 13 | - private int timeMs; | ||
| 12 | + private final int id; | ||
| 13 | + private final int timeMs; | ||
| 14 | 14 | ||
| 15 | - public Task(int timeMs) { | ||
| 15 | + public Task(final int timeMs) { | ||
| 16 | 16 | this.id = nextId++; | |
| 17 | 17 | this.timeMs = timeMs; | |
| 18 | 18 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,9 +7,9 @@ | |||
| 7 | 7 | */ | |
| 8 | 8 | public class Worker implements Runnable { | |
| 9 | 9 | ||
| 10 | - private Task task; | ||
| 10 | + private final Task task; | ||
| 11 | 11 | ||
| 12 | - public Worker(Task task) { | ||
| 12 | + public Worker(final Task task) { | ||
| 13 | 13 | this.task = task; | |
| 14 | 14 | } | |
| 15 | 15 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments