Nested Class [modified]
-
Is it possible to have a nested class like this
class a : b
{
class a
{
}}
I am curently working in a Maintenance project, i have decompiled some dll to know the coding nature inside it, there i saw similar kind of nested class. any of you have idea on this.
modified on Wednesday, February 10, 2010 7:37 AM
-
Is it possible to have a nested class like this
class a : b
{
class a
{
}}
I am curently working in a Maintenance project, i have decompiled some dll to know the coding nature inside it, there i saw similar kind of nested class. any of you have idea on this.
modified on Wednesday, February 10, 2010 7:37 AM
No. (As you would have found out if you had tried it.) You can't have the same name fro a class and a class member (which the nested class is assumed to be). The compiler will complain. You can have:
class a : b
{
class c
{
}}
If Barbie is so popular, why do you have to buy her friends? Eagles may soar, but weasels don't get sucked into jet engines. If at first you don't succeed, destroy all evidence that you tried.
-
No. (As you would have found out if you had tried it.) You can't have the same name fro a class and a class member (which the nested class is assumed to be). The compiler will complain. You can have:
class a : b
{
class c
{
}}
If Barbie is so popular, why do you have to buy her friends? Eagles may soar, but weasels don't get sucked into jet engines. If at first you don't succeed, destroy all evidence that you tried.
-
yes i do know that Nested class name cannot be as same as its holding class, but when i tried to Decompile a DLL it show similar kind of code inside that, Any idea on that
A nested class can contain anything, methods, fields, properties, events, etc. I think I do not understand what you are having a problem with. Can you try explaining what you are trying to do or having a problem with in more detail, please?
If Barbie is so popular, why do you have to buy her friends? Eagles may soar, but weasels don't get sucked into jet engines. If at first you don't succeed, destroy all evidence that you tried.