Sunday 6 November 2016

Static Class

Static Class

There are two main features of static class.

1. we cannot create an object of static class.
2. It must and should contains only static members.

The main benefit of making static class is , we do not need to create an object of this class, all the members of this class are accessible with class name.

Declaration.

A static class can be created using "static" Keyword as shown below.



Note #  In static class we have to explicitly make the members as static, static class does not automatically makes it members as static.

Example











Hope this information  helpful to you. Thank you for taking time to look at my blog. ----- Syed Sadiq Ali.      








No comments: