locked
Instantiating non-static class inside a static class member RRS feed

  • Question

  • User1437711547 posted

    I have created a non-static class with non-static members.

    Now I am trying to instantiate it inside a static class member.

    Even though I have re-compiled the class library project where I created a non-static class but the non-static class does not appear in the intelli-sense when I try to instantiate it under a static class member.

    I am wondering if this has to do with the static class. Can I only use/call static members in a static class in C#?

    Please help.

    Thursday, September 6, 2012 9:24 PM

Answers

  • User1077185331 posted

    Hi,

    You can not initiate non static class or method in static class. static class only allow static members.'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 6, 2012 9:56 PM

All replies

  • User1077185331 posted

    Hi,

    You can not initiate non static class or method in static class. static class only allow static members.'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 6, 2012 9:56 PM
  • User1437711547 posted

    Thanks for a prompt response.

    Thursday, September 6, 2012 10:13 PM