Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
int[] arr = new int[1000];
// ....
und du greifst aufs 10 element zu weist du immer genau, dass es sich um das zurückgegebene Element um einen int Wert handelt.
int i = arr[77];
...
Du kannst ein Array aber auch vom Typ Object deklarieren
Object[] objArr = new Object[100];
du könntest nun sagen
objArr[11] = new Integer(100);
objArr[12] = "Hallo";
objArr[13] = new Vector(2);
... etc,....
Original geschrieben von manja
irgenwie kann ich nicht begreifen: wo ist den Unterschied?
In Array - Objekten einen Typen in List - nicht?
Kann vielleich jmd erklären?
Ich hoffe, ich verwechsel das nicht mit der Funktionalität der HashMap...
An instance of HashMap has two parameters that affect its performance: initial capacity and load factor. The capacity is the number of buckets in the hash table, and the initial capacity is simply the capacity at the time the hash table is created. The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased. When the number of entries in the hash table exceeds the product of the load factor and the current capacity, the capacity is roughly doubled by calling the rehash method.
As a general rule, the default load factor (.75) offers a good tradeoff between time and space costs. Higher values decrease the space overhead but increase the lookup cost (reflected in most of the operations of the HashMap class, including get and put). The expected number of entries in the map and its load factor should be taken into account when setting its initial capacity, so as to minimize the number of rehash operations. If the initial capacity is greater than the maximum number of entries divided by the load factor, no rehash operations will ever occur.
Original geschrieben von Patrick Kamin
Es besteht ja aber immer noch die Möglichkeit sich selber eine dynamische Liste zuprogrammieren, dann kann man sicher sein, dass auch nur so viel Speicherplatz verwendet wird, wie wirklich benötigt wird.
Gruß
Dann sollte man heutzutage vielleicht gänzlich auf die Programmierung verzichten - oder man bleibt bei Lisp-Scripts für den Emacs, da kann man auch nicht viel kaputt machenJedes Stück Code das mann selber Implementieren muss, macht eine Anwendung instabiler und komplizierter.