Recondaddy
Newcomer
- Joined
- Sep 19, 2012
- Messages
- 5
Hello everyone,
I'm not a software engineer, so I'm certain this is probably something that you guys see all the time, but it's a first for me.
I'm reverse engineering a sample C# console application, and I ran across a scenario I don't quite understand -- a class instantiating itself within itself. Here's a simplified example of what I mean:
I hope that's enough to see what I'm talking about. Does anyone know what the developer was trying to accomplish here?
Thanks for any help you can provide.
I'm not a software engineer, so I'm certain this is probably something that you guys see all the time, but it's a first for me.
I'm reverse engineering a sample C# console application, and I ran across a scenario I don't quite understand -- a class instantiating itself within itself. Here's a simplified example of what I mean:
Code:
class Program
{
static void Subroutine1()
{
DoSomething
}
static void Main(string[] args)
{
Subroutine1();
[B]Program program = new Program();[/B]
...
...
...
program.Subroutine2();
}
void Subroutine2()
{
DoSomethingElse
}
}
I hope that's enough to see what I'm talking about. Does anyone know what the developer was trying to accomplish here?
Thanks for any help you can provide.