You are attempting to assign an integer variable to a long variable, but Kotlin compiler flags it as an error. Why?

Question:You are attempting to assign an integer variable to a long variable, but Kotlin compiler flags it as an error. Why?

1.You must wrap all implicit conversion in a try/catch block

2.You can only assign Long to an Int, not the other way around

3.There is no implicit conversion from Int to Long

4.All integers in Kotlin are of type Long


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!