Link to home
Start Free TrialLog in
Avatar of rajesh_khater
rajesh_khater

asked on

Equivalent of VB.NET Modules in C#?

Is there any equivalent of VB.NET modules in C#?

I have a lot of constant variables, which I want to define in a separate file as public const variables.

I want to access these public variables directly without qualifying them with the class name or object name.

This is possible in VB.NET. Can we do a similar thing in C#?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"I want to access these public variables directly without qualifying them with the class name or object name"

surely you can see that using the object name makes for much more structured and manageable code?

imagine designing the same variable name in two separate files, thus ambiguity sets in and you must then distinguise between them anyway.

Andrew