我一直以為 instanceof 是測試某個物件是否為某個類別的實體,實際上語法看起來也是這樣。 String aString = "a string"; boolean bool = aString instanceof String; System.out.println(bool); 想當然爾,結果當然是 true。
About life and how to live. No matter what others said, I will keep brave and move forward.