Kevin Janvier Chinabalire
06/13/2018, 9:20 PMfun bindview(pool:Any){
//want to convert
}
I have my class
class Users(var name, var id)
malone
06/13/2018, 9:29 PMObject
, so Any
will work fine. If you have a Java API and should pass an Object
instance, you can pass the Any
as it is and the compiler will make it work.Kevin Janvier Chinabalire
06/13/2018, 9:32 PMmalone
06/13/2018, 9:35 PMpool
as another type, let's say Pool
?malone
06/13/2018, 9:35 PMas?
malone
06/13/2018, 9:36 PM(pool as? Pool)?.doSomething()
Kevin Janvier Chinabalire
06/13/2018, 9:36 PMKevin Janvier Chinabalire
06/13/2018, 10:00 PMKevin Janvier Chinabalire
06/13/2018, 10:00 PMedwardwongtl
06/14/2018, 3:51 AMas
Kevin Janvier Chinabalire
06/14/2018, 5:52 AMedwardwongtl
06/14/2018, 5:53 AM