-
You do not have to import anything under
java.lang
to use it.-
import java.lang.Math;
-
-
Do not compare booleans.
-
if (something == true) { ... } // NANI?
-
-
Use string concatentation sparingly.
-
@Override public String toString() { return plate + " (" + time + " mins away) NormalCab"; } // BETTER AND MORE READABLE WAY! public String toString() { return String.format("%s (%d mins away) NormalCab"); }
-
-
Don't abuse the
this
keyword when there are no name conflicts! Just the variable or function as it is! As long as it's within the class body, the class knows its calling itself! The rules ofsuper
keyword still applies if you are calling from super classes.