Skip to content

Instantly share code, notes, and snippets.

View hascode's full-sized avatar

Micha Kops hascode

View GitHub Profile

Overview of my Blog Articles at hascode.com

Introduction

@hascode
hascode / Main.java
Created July 5, 2017 07:40
Java Externalizable Example
package com.hascode.sample;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.time.ZonedDateTime;
public class Main {
@hascode
hascode / WeakHashmapExample.java
Created April 24, 2018 10:13
Java - WeakReference and WeakHashMap examples
package net.seibertmedia;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.TimeUnit;
public class WeakHashmapExample {
public static void main(String[] args) throws InterruptedException {
Map<Person, String> map = new WeakHashMap<Person, String>();
Person p1 = new Person("Jeff1");