22
Reply

what is the default access specifier within the namespaces in c#?

masthan p

masthan p

11y
6.7k
1
Reply

    Internal if it is directly declared inside namespace.Private if it is nested.Here's some explanation:Classes and structs that are declared directly within a namespace (in other words, that are not nested within other classes or structs) can be either public or internal. Internal is the default if no access modifier is specified.Struct members, including nested classes and structs, can be declared as public, internal, or private. Class members, including nested classes and structs, can be public, protected internal, protected, internal, or private. The access level for class members and struct members, including nested classes and structs, is private by default. Private nested types are not accessible from outside the containing type.

    no namespace is required for access specifier

    internal for other types refer following linkhttp://sandeepmhatre.blogspot.com/2013/04/access-specifier-in-c.html

    internal for other types refer following linkhttp://sandeepmhatre.blogspot.com/2013/04/access-specifier-in-c.html

    internal for other types refer following linkhttp://sandeepmhatre.blogspot.com/2013/04/access-specifier-in-c.html

    internal for other types refer following linkhttp://sandeepmhatre.blogspot.com/2013/04/access-specifier-in-c.html

    internal for other types refer following linkhttp://sandeepmhatre.blogspot.com/2013/04/access-specifier-in-c.html

    Namespace will not have access modifier.

    private

    private

    Internal if it is directly declared inside namespace.Private if it is nested.Here's some explanation:Classes and structs that are declared directly within a namespace (in other words, that are not nested within other classes or structs) can be either public or internal. Internal is the default if no access modifier is specified.Struct members, including nested classes and structs, can be declared as public, internal, or private. Class members, including nested classes and structs, can be public, protected internal, protected, internal, or private. The access level for class members and struct members, including nested classes and structs, is private by default. Private nested types are not accessible from outside the containing type.

    internal

    Private

    Private

    In c#.net by default access specifier is internal.......

    public

    internal

    Private

    Internal

    Public

    internal