Can we write a c# program without a Class or Structure?
Can we write a c# program without a Class or Structure? If possible can anyone give an example?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 16, 2011, 10:06 AM
Mahesh ChandPosted Jun 16, 2011, 9:51 AM
As everybody else said, there must be at least one class that MUST have the Main method, that is the starting point of a C# application and that is what C# compiler looks for when compile the code.
Guest UserPosted Jun 16, 2011, 8:52 AM
VulpesPosted Jun 16, 2011, 8:34 AM
You need at least one class or struct to contain your Main() method as C# doesn't support global functions.
Abhimanyu K VatsaPosted Jun 16, 2011, 8:33 AM
i) C# is fully OOP oriented and it must need at-least a parent class or struct
ii) C# is purely developed to support encapsulation and if you avoid classes then it will not execute
Let's wait for more reply here.