G
Guest
Hi Newbee here to C# I have a simple questions...
In a Hello world example how does the class object Hello exist with out
creating it? I come from object pascal where everything object is created
then used. In object pascal you can call a method a "class" and it means you
can call it by the name of the class and the function name with out creating
it like "Hello.Main()" is that true for key word "static"?
Also what if I have more than one class that has "Main"?
Can I tell the system what "Main" to use (not via comand line)?
class Hello
{
static void Main( )
{
// Use the system console object
System.Console.WriteLine("Hello World");
}
}
Davinci
In a Hello world example how does the class object Hello exist with out
creating it? I come from object pascal where everything object is created
then used. In object pascal you can call a method a "class" and it means you
can call it by the name of the class and the function name with out creating
it like "Hello.Main()" is that true for key word "static"?
Also what if I have more than one class that has "Main"?
Can I tell the system what "Main" to use (not via comand line)?
class Hello
{
static void Main( )
{
// Use the system console object
System.Console.WriteLine("Hello World");
}
}
Davinci