Text from a book that I don't understand

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hello!

I'm reading a book called Visual C# 2005 and there one thing here that you
might be able to answer.

public class MyClass
{
// Class member
}
Here is the text that I don't understand what they mean. It says "Note that
classes declared in their own right in this way
cannot be private or protected." what do they mean by that ?

//Tony
 
Hello!

I was to fast to sent the question.
When I come to think about the question I found the answer myself.

//Tony
 
Maybe you should include the answer in your follow up post, in case there is
someone reading that doesn't know :-)
 
My understanding is that you can't declare a class private or
protected because private would mean that nothing could use it outside
of itself and thus it would be a useless class. Protected would say
that this class can only be used by another class that inherits from
it, but if its protected nothing can inherit from it also making it a
useless class.
 
Back
Top