Topics
Published on October 15, 2017 by ProgrammingKnowledge

– if (condition) { statements } else { statements }
-The value is the value of whichever block is chosen
-If the value is to be used, both blocks should have the same type, otherwise the type of the result is the “least upper bound” of the two types
– if (condition) { statements }
-The value is the value of the last statement executed, but its type is
Any – if you want a value, you really should use an else

————————-Follow——————-
My Website – www.codebind.com
My Blog – goo.gl/Nd2pFn
My Facebook Page – goo.gl/eLp2cQ
Google+ – goo.gl/lvC5FX
Twitter – twitter.com/ProgrammingKnow
Pinterest – goo.gl/kCInUp
Text Case Converter – goo.gl/pVpcwL
Epoch Timestamp Converter – goo.gl/Zedjo5
Decimal – Binary – Hexadecimal Converter – goo.gl/rkX3JE
8-bit Checksum Calculator – goo.gl/inxvIT

Leave a Reply

3 Comments on "Scala Tutorial 7 – Scala – IF ELSE Statements"

Notify of
avatar

Tip Tech
Guest
Tip Tech
11 days 4 minutes ago

println(((x != 20) ? x = 20 : x = "nothing"));In short

Noel Peralta
Guest
Noel Peralta
4 months 3 days ago

Hi

Noel Peralta
Guest
Noel Peralta
4 months 3 days ago

Hi

wpDiscuz