Assign the variable
"list" to a list with no elements
ruby list = Array.new
list = Array.new
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>();
}
}
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;
}
fantom list := [,]
class SolutionXX
{
Void main()
{
list := [,]
}
}
Submit a new solution for
ruby,
erlang,
csharp,
cpp ...
There are 19 other solutions in
additional languages (
clojure,
fsharp,
go,
groovy ...)