---
title: "Note on Singleton"
author: "louisling"
date: "2007-11-26T10:47:52Z"
tags: ["Google"]
slug: "note-on-singleton"
draft: false
lastmod: "2007-11-26T10:47:52Z"
id: 143530
url: "https://louisling.iteye.com/blog/143530"
---

```
//From Google - Bob Lee. (Jeremy Manson, Brian Goetz)
public class Singleton {
    private static class SingletonHolder {
        static Singleton instance = new Singleton();
    }

    public static Singleton getInstance() {
        return SingletonHolder.instance;
    }

    private Singleton() {
    }
}
```