Text from a book that I don't understand

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
 
T

Tony

Hello!

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

//Tony
 
P

Peter Morris

Maybe you should include the answer in your follow up post, in case there is
someone reading that doesn't know :)
 
C

cfps.Christian

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top