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()
}
csharp 3var list = new List<object>();
using System.Collections.Generic;
class SolutionXX
{
static void Main()
{
var list = new List<object>();
}
}
cpp C++/CLI .NET 2.0Generic::List<String^>^ list = gcnew Generic::List<String^>();
using namespace System;
using namespace System::Collections;
int main()
{
Generic::List<String^>^ list = gcnew Generic::List<String^>();
}
cpp std::list<std::string> list;
#include <string>
#include <list>
int main()
{
std::list<std::string> list;
}
Submit a new solution for
scala,
csharp, or
cpp
There are 20 other solutions in
additional languages (
clojure,
erlang,
fantom,
fsharp ...)