Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* levelezősök
  + Adator. prog.
  + feladatsor
  + quick link

teaching assets


Félévek

* 2024/25/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

20150313a

#############################

if / else

The if / else construct is an expression, thus it has a value that you can store in a variable:

val s = if (x > 0) "sca" else "la"    // s is either "sca" or "la", depending on x

Unit

The equivalent of void is Unit. Unit is a class that has one value, written as ().

Block ( { … } )

The value of a block is the value of its last expression. Thus, you can write such things as:

scala> val x = {
     | val a = 5    // local variable of the block
     | val b = 3
     | scala.math.pow(a, b)
     | }
x: Double = 125.0
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2018 February 15, 16:14