+ 2

Can we use conditional statements with functions or anynother data types ?

7th Jan 2021, 1:40 PM
Lasindu Migara
Lasindu Migara - avatar
2 Answers
+ 2
if your questions is can I use another data types in `if condition` like ```kt if(9) print("Hello kt") ``` No, `if` only alows boolean return types or you can use `equal` I.e(`==`, `=` differ b/n langs) to return bool between 2 different types
7th Jan 2021, 1:47 PM
Ananiya Jemberu
Ananiya Jemberu - avatar