Left: Data to check Right: Data type (Array, Object, etc.) Returns true if it is the specified type itself or its parent/ancestor Returns false if a child or descendant type is specified Very useful ...
Object obj = 5; if (obj instanceof String s) { System.out.println(s.length()); // Stringではないので何も表示されない } String s received obj as a ...