Sachin Rana

02/02/2021, 2:10 PM
#getting-started Hi All, Does anyone tell me the difference between Kotlin data types and Java data types? As, I am learning about Kotlin data types and I found that in case of Kotlin Data Type we can directly use method like minus, divide etc. directly without using Wrapper Classes as we use in case of Java.


02/02/2021, 5:19 PM
you can use minus/divide/operators with any class in Kotlin provided it defines the method (with
keyword) or an extension method, not just data classes
oh, you're talking about data types, not data classes I think this might cover it. basically it boxes automatically, e.g. Int is unboxed when used as a local var, but boxed when used in a Map (e.g. Map<Int, Int>) or as a nullable type (Int?)