<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://coderwiki.org/index.php?action=history&amp;feed=atom&amp;title=Array</id>
	<title>Array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://coderwiki.org/index.php?action=history&amp;feed=atom&amp;title=Array"/>
	<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Array&amp;action=history"/>
	<updated>2026-05-19T02:44:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://coderwiki.org/index.php?title=Array&amp;diff=54&amp;oldid=prev</id>
		<title>Dylan: new</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Array&amp;diff=54&amp;oldid=prev"/>
		<updated>2025-08-09T13:26:22Z</updated>

		<summary type="html">&lt;p&gt;new&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;An &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039; is simply a &amp;#039;&amp;#039;collection of [[Value|values]]&amp;#039;&amp;#039;. They are stored [[Memory layout|next to each other]] in [[memory]] so can be accessed directly using their [[memory address]] (plus an [[Pointer offset|offset]] to get the [[value]] at a specific [[Array index|index]]).&lt;br /&gt;
&lt;br /&gt;
== Array data types ==&lt;br /&gt;
Arrays must contain [[Value|values]] of only one [[data type]].&lt;br /&gt;
&lt;br /&gt;
For example, this array would be fine as it only contains [[Integer|integers]]:&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
[4, 9, 20, 50, 299]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;However this array would not be, as it contains both [[String|strings]] &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; [[Boolean|booleans]]:&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
[&amp;quot;hello&amp;quot;, &amp;quot;world&amp;quot;, true, &amp;quot;Tokyo&amp;quot;, false]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Some [[Dynamic typing|dynamically-typed]] [[programming languages]], such as [[Python]], allow you to have [[Value|values]] of multiple [[Data type|data types]] in a single [[list]]. No [[Static typing|statically typed]] programming language offers this.&lt;br /&gt;
&lt;br /&gt;
== Common array + collection methods ==&lt;br /&gt;
There are some common [[Method|methods]] or [[Field|fields]] you can access on arrays, [[List|lists]] and other [[Collection|collections]] in most programming languages. They may have different names to those listed below, but should be present.&lt;br /&gt;
&lt;br /&gt;
* [[Collection get|get(index)]] - to get the [[value]] at a specific [[Array index|index]]&lt;br /&gt;
* [[Collection set|set(index, value)]] - to set the [[value]] at the specified [[Array index|index]]&lt;br /&gt;
* [[Collection append|append(value)]] - to add a value to the end of a [[collection]] (usually only works with [[Dynamic typing|dynamically-typed lists]] as with [[static typing]], [[Array length|array lengths]] are fixed)&lt;br /&gt;
* [[Collection length|length]] - to get the number of elements in the [[collection]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
</feed>