开发者

What type of class do I need for this?

开发者 https://www.devze.com 2023-01-23 09:47 出处:网络
I want to create a class that is usable without being instanced, but that can also be instanced. Similar to a math class I suppose.

I want to create a class that is usable without being instanced, but that can also be instanced. Similar to a math class I suppose.

T开发者_运维问答hanks


If you add static methods to the class, you can call them like this

 ClassName::staticMethod();

You are not stopped from also creating instances of this class.


A regular class with a constructor with static class functions.

0

精彩评论

暂无评论...
验证码 换一张
取 消