Note:
1. String has length but it should be called by str.length()
2. indentation of +:
(error⬆️)
如果字数太多要换行,遇到"+"要另起一行并indent
3. 一些methods:
int count = Integer.parseInt(parts[1]);
assert string != null;
asser string.endsWith(".com");
int i = string.indexOf(string);
char A = string.charAt(index);
String[ ] a = string.split("\n");
return a[0];
array变回string: String.valueOf(array);
Quiz 4
-MCQ错题(1道)
object contains: state and behavior
-Coding错题(1道)
prompt:
错因:当时不知道应该怎样remove surrounding whitespace
应该用trim method(当时看课的时候跳过了讲trim( )的部分,所以quiz考到了就不会了)