单例模式详解

饿汉式packagecom.ph.single;//饿汉式单例模式publicclassHungry{//可能会浪费空间,开辟了空间,却没有使用privateHungry(){}privatefinalstaticHungryHUNGRY=newHungry();publicstaticHungry