What is the difference between:
namespace Library{
class File{
//code inside it
}
}
and:
namespace Library{
public class File{
//code inside it
}
}
So what will be the difference between public class and class?
Without specifying public
the class is implicitly internal
. This means that the class is only visible inside the same assembly. When you specify public
, the class is visible outside the assembly.
It is also allowed to specify the internal
modifier explicitly:
internal class Foo {}