Thursday, September 14, 2017

Static Keyword

When we declare a class as Static then all the elements in the class will be static.If the class is Static then Most of the oops features won't be applied on this class. Like No inheritance, No polymorphism,No Interface, No Abstract etc.
Even the object of this class will be created only once in memory, therefore its constructor will be suitable for caching in memory data.
Mostly Static class is Utility class which doesn't have anything do do with real world object.

No comments:

Post a Comment