Static Classes in COBOL.Net

[Migrated content. Thread originally posted on 19 January 2011]

How do we define Static classes in COBOL.Net? I am looking for equivalent of C# or Java. I see that we can define static blocks and also can specify static attribute on methods, but ran into some issues when I used static block. I am using Visual COBOL R3 (Beta).

  • Verified Answer

    I don’t think you can create a static class in COBOL but...

    My understanding is that a static class simply indicates the class contains only static members AND cannot be instantiated.

    So I suppose you could simulate this by hiding the constructor, NEW(), and then declare your static members.

    But you mentioned you encountered issues with static blocks – could you elaborate?