This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

a simple question  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i delete the code i dont understand where was mistake and i try to do with words .If i have a loop with if i should be oblige to write this always if(){}else if(){}else{}? or can i do this if(){}else if(){} .I mean to stop on if with no use the "else{}" .Can i do that?
 
Tim Cooke
Marshal
Posts: 3853
233
Clojure IntelliJ IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you are not required to always include the else condition. All of the following are valid:



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!