Is there a simple way to determine if a variable is a list, dictionary, or something else? Basically I am getting an object back that may be either type and I need to be able to tell the difference.
In Python, we have "Type()", "Typeof()" that
scala> val c: String = "Hello world"
Is there any way to determine : Typeof(c) to print : String
I believe you can just use:
c.getClass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With