The question says it all. Some quick code examples would be nice .. thanks!
is=> instanceof( JLS link ), for example:
is
instanceof
Object foo = "hello"; if (foo instanceof String) { // Yup, it a string }
In Java, there is no equivalent to the C # operator as.
as
is(C #) → instanceof(Java)
And you do not get the direct equivalent as. You could try this liner though:
SomeParentType obj = original instanceof Child ? (SomeParentType)original : null;
Source: https://habr.com/ru/post/1736324/More articles:JSF Back Button - jsfNeed help implementing a simple socket server using GIOService (GLib, Glib-GIO) - cReading a byte from Intptr - c #Java: forward class declarations in namespaces - javaLoadOperation.Completed against callback in DomainContext.Load () - silverlight-3.0Buying iphone in the app - iphoneWhat settings allow my application to control battery life? - androidHow easy is it to convert an application from Visual Foxpro 6 to Visual Foxpro 9? - visual-foxproTemplate Interdependence - c ++Как объявить постоянный набор, видимый для каждого экземпляра класса? - javaAll Articles