Jaish Mathews
posted
328 posts
since
Aug 12, 2005
from
Bangalore, India
|
|
Re: what is shared void main and void main?
|
|
|
|
|
|
|
|
|
|
|
Hi,
C# Static = VB.NET Shared
Both key word meant for single copy for any number of object instance rather than each object has it's own copy.
In console application, one automatic entry point needed as these applications are normally GUI free. More over this entry point won't call explicitly, but initiated automatically. So only once instance of this method needed as no user is going to create an object and call this Main() explicitly.
|
|
|
|
|
|
Sam Hobbs
posted
6490 posts
since
Sep 07, 2009
from
Los Angeles, California, USA
|
|
Re: what is shared void main and void main?
|
|
|
|
|
|
|
|
|
|
Note that this question is essentially the same as your what is static void main?. It is better to not ask the same question more than once because people might answer a question that already has answers elsewhere. I might choose to ignore questions when I see duplicates.
In VB.Net, if Main is in a class then you must use Shared else you don't have to use Shared. Otherwise my explanation in your other thread is relevant here too.
|
|
|
|
|
Thinking is a feeling; pleasant for some and unpleasant for others.
|
|
|
|
|
|