Assign the variable
"list" to a list with no elements
scala val list = Nil
object SolutionXX extends Application {
val list = Nil
}
scala val list = List()
object SolutionXX extends Application {
val list = List()
}
scala val list : List[String] = List()
object SolutionXX extends Application {
val list : List[String] = List()
}
erlang List = [],
-module(emptylist).
-export([start/0]).
start() ->
List = [],
io:format("~B~n", [length(List)]).
csharp 3var list = new List<object>();
using System.Collections.Generic;
class SolutionXX
{
static void Main()
{
var list = new List<object>();
}
}
Submit a new solution for
scala,
erlang, or
csharp
There are 21 other solutions in
additional languages (
clojure,
cpp,
fantom,
fsharp ...)