a
This commit is contained in:
@@ -10,5 +10,6 @@
|
||||
<orderEntry type="library" name="openjfx.javafx.base" level="project" />
|
||||
<orderEntry type="library" name="openjfx.javafx.graphics" level="project" />
|
||||
<orderEntry type="library" name="openjfx.javafx.controls" level="project" />
|
||||
<orderEntry type="library" name="scala-sdk-2.13.12" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
14
WS23_24/Anwendungsentwicklung/src/Klausur_ueb/Lambda.scala
Normal file
14
WS23_24/Anwendungsentwicklung/src/Klausur_ueb/Lambda.scala
Normal file
@@ -0,0 +1,14 @@
|
||||
package Klausur_ueb
|
||||
|
||||
object Lambda {
|
||||
def main(args: Array[String]): Unit = {
|
||||
val a = Array(1, 2, 3, 4, 5)
|
||||
val summe = a.reduce((x: Int, y: Int) => x + y)
|
||||
val summeKuerzer = a.reduce((x, y) => x + y)
|
||||
val summeNochKuerzer = a.reduce(_ * _)
|
||||
val summeGanzKurz = a.sum //vordefiniert
|
||||
println(summeGanzKurz)
|
||||
println(summeNochKuerzer)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user