Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

* Scripting Languages
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* aktuális (2023/24/2)
* 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