java
java copied to clipboard
Adding analyzer feedback for `captains-log` concept exercise
I've been going through the community solutions and these solutions stood out to me:
| Solution | Observations |
|---|---|
| Link | Hard-coding the number of planet classes (10) instead of using the length of the array, could be an actionable comment. |
| Link | This solution uses a Java version >= 17, judging by the usage of the RandomGenerator.nextDouble(double) method added in Java 17. However, those Java versions also contain RandomGenerator.nextDouble(double,double) and RandomGenerator.nextInt(int,int) which support passing both a lower and upper bound, which makes the solution a bit easier to read. Could be an informative comment. |
I've been going through the community solutions and these solutions stood out to me:
Solution Observations Link Hard-coding the number of planet classes (
10) instead of using the length of the array, could be anactionablecomment. Link This solution uses a Java version >= 17, judging by the usage of theRandomGenerator.nextDouble(double)method added in Java 17. However, those Java versions also containRandomGenerator.nextDouble(double,double)andRandomGenerator.nextInt(int,int)which support passing both a lower and upper bound, which makes the solution a bit easier to read. Could be aninformativecomment.
I liked that options, seems that they are more appropriate and can actually help the student!