| References | Casting | Arrays | Import | instanceof | Package | Synchronization | Throwable | finally | Dangerous | Stack | String |
In Java, the instanceof is an operator. In acdk, it can be used in a similiar way.
// Java void foo(Object object) { if (object instanceof String) { // it is now save to cast it String astr = (String)object; } } |
In acdk, you can do this with the same idiom:
// C++ / acdk void foo(RObject object) { if (instanceof(object, String)) { // it is now save to cast it RString astr = (RString)object; } } |
< prev | Constructs(5 / 12) | next > |