Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您将如何防止客户直接实例化您的具体类?
比如你有一个Cache接口和两个实现类MemoryCache和DiskCache,你如何保证这两个类的对象没有被客户端使用new()关键字创建。
谢谢