- remember that the instance variable must be used in the conductor (do NOT create new local variables and assign values)
- when calling a method, parentheses must be added regardless of whether the method has parameters or not)
- in general, public methods in a class cannot be called from another class unless:
- The class is referenced explicitly (e.g.,
ClassName.method() for static methods).
- The method is called on an instance of that class (e.g.,
obj.method() for instance methods).
- && 比 || 优先运算 Operator Precedence
- only “new” keyword create new memory address (object)
- 用变量进行判断不会改变其本身,例如
if(x / 10 % 2 == 0) 和 while(y > 0)
- Generally,
str.substring(str.length()) returns an empty string. It doesn’t throw out of bounds exception.