Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java (ArrayList (Loop (for(int i =0; i < arr.size(); i ++), for (string…
Java
-
HashMap
HashMap<String, String> kv = new HashMap<String, String>();
add key-value
kv.put("VN", "Viet Nam")
get(), remove(), clear()
kv.get("VN");
kv.remove("VN");
kv.clear();
access to key and value
for(String k : kv.keySet()){
sout(k, kv.get(k))
}
-
Constructor
public class Car {
int modelYear;
String modelName;
public Car(int year, String name) {
modelYear = year;
modelName = name;
}
}
Set
TreeSet
TreeMap<Interger, String> map = new TreeMap<Interger, String>();
map.firstKey();
map.lastKey();
-