Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi...

say if I have a class with the following definition:

public class Test
{
public enum testEnum
{
fred,
joe
};
public testNum TestEnum
{
get
{
return test;
}
set
{
test = value;
}
}
public Test() {}
private testEnum test;
}


As soon as I change 'public enum testEnum' to 'private enum testEnum', the program wont' compile...

My question is, why can't it be done ? I would like the type 'enum testEnum' to be private to the class only.

anyone ?

Thanks in advance.


 
I think I have figured out the question...

there is no point to have a property 'TestEnum' which returns type 'enum testEnum' if this type is made private to the class... the calling class wouldn't be able to instantiate the type 'enum testEnum' because it's private to 'class test'.

sorry, I really get myself confused...

thanks for reading.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top