|
-
August 10th, 2011, 09:45 AM
#1
Just when I thought I fully understood static vs non-static methods...
I was looking through a program I am working on, and my Form1 class has several methods that are NOT static, but I call them like they are static.
Code:
public partial class Form1 : Form
{
public Form1()
{
//constructor
DoSomething();
}
private void DoSomething()
{
}
}
since DoSomething is not static, I thought it would need an object reference, such as this.DoSomething()???
But this does compile and run, so I am confused.
What did I miss when I was studying static methods?
Skip
Last edited by MrGibbage; August 10th, 2011 at 09:48 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|