justjofe
  • Member for 4 years, 6 months
  • Last seen more than 4 years ago
Checking if a number is Armstrong number or not
2 votes

I'll concentrate mainly on shortening lines and removing unnecessary code lines as it heavily increases the readability of the source code. #main(String[] args) The first thing I noticed is that you ...

View answer
Java Drawing House
2 votes

Variables and data types As you calculate the result of measurement / 2 pretty often, I would store it in a variable as it is a bit, not really noticeable faster but it makes the code more readable ...

View answer
Generate die rolls using coin flips
Accepted answer
2 votes

I think your solution still has some potential but you don't need an Enum for the #getCoinToss method because you don't have any advantage over using an Integer. Not using simple integers might even ...

View answer
Soldier class, with health points
Accepted answer
0 votes

The short answer is yes, you succeeded in implementing encapsulation 100% correctly. Still, I have some smaller problems with your code: Useless method I noticed that you have a setter method for ...

View answer