mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
scala
This commit is contained in:
parent
7efffcec0c
commit
7a39159bdb
5 changed files with 19 additions and 10 deletions
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env scala
|
||||
!#
|
||||
def promptprint (s: String) = {println ("> " + s)}
|
||||
$ scala
|
||||
Welcome to Scala version 2.9.2 [...]
|
||||
|
||||
println ("Hallo ")
|
||||
args foreach promptprint
|
||||
scala> println("Hello world")
|
||||
Hello world
|
|
@ -3,4 +3,6 @@ class Person (
|
|||
var lastName: String,
|
||||
age: Int) {
|
||||
println("This is the constructur.")
|
||||
|
||||
def sayHi() = println("Hello world!")
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
val anna = new Person("anna", "bern", 18)
|
||||
anna.sayHi()
|
Loading…
Add table
Add a link
Reference in a new issue