Login
|
Signup
langref.org
-
scala
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
ruby
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Declaration
Define a static list
Define the list
[One, Two, Three, Four, Five]
scala
val list = "One" :: "Two" :: "Three" :: "Four" :: "Five" :: Nil
object SolutionXX extends Application {
val list = "One" :: "Two" :: "Three" :: "Four" :: "Five" :: Nil
}
scala
val list = List("One", "Two", "Three", "Four", "Five")
object SolutionXX extends Application {
val list = List("One", "Two", "Three", "Four", "Five")
}
scala
val list: List[String] = List("One", "Two", "Three", "Four", "Five")
object Solution412 extends Application {
val list: List[String] = List("One", "Two", "Three", "Four", "Five")
}
Submit a new solution for
scala
There are 33 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)