I guess my question is would
static class example1{
function example1_function(){};
}
and
class example2{
static function example2_function(){};
}
lead to the same result, which is both example1->example1_function() and example2->example2_function() have the same callabilty. Would both be defined as static and usable as such?
You cannot declare a class as a static class, as stated by other members here, but there is a method where you can stop the class from becoming an object, you can use the
abstractkeyword to specify the object should not be instantiated using the new keyword, this is good for inheritance etc.Doing
new Somethingwould trigger an error stating you cannot instantiate the class, you can then declare your static methods like so:You still have to declare you methods as
static, this is just the way it is.and then you can use like so:
Hope this clears up a few thing’s