Skip to content

Instantly share code, notes, and snippets.

@mohno007
mohno007 / hashmap.java
Last active January 25, 2019 05:55
HashMap `javac hashmap.java && java -enableassertions hashmap`
import java.lang.SuppressWarnings;
import java.util.Optional;
import java.util.Objects;
class hashmap {
static class HashMap<K, V> {
private class Entry {
public final K key;
public V value;
struct Obj {
value: i64
}
fn main() {
let x = Obj { value: 1 };
// x.value = 2; // 無理
let mut y = Obj { value: 1 };
y.value = 2;