Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.ref.SoftReference;

public class Main {
    private static SoftReference<StringBuffer> strBfeCache;

    private static StringBuffer getStrBuf() {
        StringBuffer result = null;
        if (strBfeCache != null)
            result = strBfeCache.get();
        if (result == null) {
            result = new StringBuffer();
            strBfeCache = new SoftReference<StringBuffer>(result);
        }
        return result;
    }
}