ensure a class has only one instance,and provide a global point of access to it

package com.design_patterns.www.singleten;

/*********************
 * @author ge_star
 * 单例模式核心类
 */
public class Singleten {
	private final static Singleten mSingleten = new Singleten();
	private Singleten(){}
	public static Singleten instance(){
		return mSingleten;
	}
	public static void sayHello(){
		System.out.println("this is singleten test....");
	}
}

package com.design_patterns.www.client;

import com.design_patterns.www.singleten.Singleten;
/*********************
* 使用类
*/
public class Client {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Singleten mSingleten = Singleten.instance();
		mSingleten.sayHello();
	}

}