J
Jason Shohet
I noticed that there are two ways I declare classes:
1. public class xxxx { }
2. Somewierdclass myClass;
The 2nd example exists provided I have a 'using' statement at the top that
includes that class from some place. I am wondering, why does the 2nd way
not require a scope (ie public) ? And why doesn't it require the keyword
'class'. Is it because 'class' denotes an empty.NET class, whereas
Somewierdclass is something that already exists.
I am guessing thats also why the 1st example has brackets & the 2nd doesn't.
Because the first example is an empty .NET class and the members of the
class are defined in the { } 's. But the 2nd example is a ready-built class
from somewhere else, and so we can't add on members to a pre-existing class
coming from somewhere else, hence no brackets?
Thanks for any correction / confirmation of the above
Jason Shohet
1. public class xxxx { }
2. Somewierdclass myClass;
The 2nd example exists provided I have a 'using' statement at the top that
includes that class from some place. I am wondering, why does the 2nd way
not require a scope (ie public) ? And why doesn't it require the keyword
'class'. Is it because 'class' denotes an empty.NET class, whereas
Somewierdclass is something that already exists.
I am guessing thats also why the 1st example has brackets & the 2nd doesn't.
Because the first example is an empty .NET class and the members of the
class are defined in the { } 's. But the 2nd example is a ready-built class
from somewhere else, and so we can't add on members to a pre-existing class
coming from somewhere else, hence no brackets?
Thanks for any correction / confirmation of the above
Jason Shohet