单例类可以是静态的吗? [英] Can singleton class be static?

查看:95
本文介绍了单例类可以是静态的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单例类可以是静态的吗?

Can singleton class be static?

推荐答案

否。单例类意在被实例化,因为该术语本身指的是一个实例;如果你使它成为一个静态类,你不能创建一个单例对象。

No. A singleton class is meant to be instantiated, because the term itself refers to an instance; if you make it a static class, you can't create a singleton object out of it.

这篇关于单例类可以是静态的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆