locked
class static vs non-static RRS feed

  • Question

  • User888441741 posted

    what is performance hit static class vs non-static?

    is this the same performance? i mean when you have non-static class you have to instantiate the class in order to use so does it performance hit when you instantiate the class?

     

    thanks.

    Friday, September 15, 2006 11:18 PM

Answers

  • User1439985827 posted
    There is a slight peformance increase on a static class because an instance of the class is not created and set in memory. The drawback to a static class is that it can only contain static members and a static constructor with no arguements.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 16, 2006 12:57 AM