A demo to know about 4 types of java reference (Strong, Soft, Weak and Phanton).