C# .cs file name and class name need to be matched?

c#, classname, filenames

Solution

No, there is no similar requirement.

Yes, you can do this.

It is considered bad practice, however.

Microsoft StyleCop will warn you if you do this, but everything will compile fine.

Problem

In Java the file name must be the public class name defined in that java file. Does C# has similar requirement? can I have a A.cs file which only defines a public Class B inside? thanks,

Original source