Let me start with the glaring issue, I want to get that done, and leave the rest to others,,
#Formatting
Formatting
Your code formatting is messy. there is just three things that are not indented in a java-file as per conventions.
these three things are:
- Package-declaration
- Import statements
- Class-opening and closing
Everything else is usually indented by either 4 spaces or 1 tab, in the least!
You nicely indented your for-loops though ;)
In addition to that, your operators and statements are a bit very cramped.
Oracle advises to and uses a few tricks to make operations more visible to the programmer:
- Arithmetic operators (+,-,*,/,<,>) have a space before and after
- Same goes for logical operators (&&,||,...)
- before opening and after closing parentheses there is a space, but not if it's respectively after or before another parenthesis.