InstanceOf application

xiaoxiao2021-04-05  249

INSTANCEOF

InstanceOf is a binary operator of Java, and ==,>,

String s = "i am an object!"; Boolean isobject = s instanceof object;

We declare a String object reference, point to a String object, then use instancof to test whether the object it is pointing is an instance of the object class, obviously, this is true, so returns true, that is, isobject is True.

转载请注明原文地址:https://www.9cbs.com/read-132217.html

New Post(0)