Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. access modifiers

access modifiers

Scheduled Pinned Locked Moved C#
question
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pavanteja
    wrote on last edited by
    #1

    can anybody explain about friend and protected friend briefly? i have seen somewhere it is protected or friend but not protected and friend...what is the use of protected friend? we have friend, protected separately?:)

    pavan...

    O 1 Reply Last reply
    0
    • P pavanteja

      can anybody explain about friend and protected friend briefly? i have seen somewhere it is protected or friend but not protected and friend...what is the use of protected friend? we have friend, protected separately?:)

      pavan...

      O Offline
      O Offline
      originSH
      wrote on last edited by
      #2

      It's not called 'friend' in C# it's 'internal'. 'internal' means any class in the same assembly can access it. 'protected' means any class that any inheriting class can access it. 'internal protected' (or 'protected internal' ;) ) means that any class in the same assembly AND any inheriting class can access it. In .Net 2.0 you can have 'friend' assemblies. If you make an assembly a 'friend' of another then it will have access to anything marked internal as if it was in the same assembly. MSDN: Access Modifiers[^] MSDN: Friend Assemblies[^]

      P S 2 Replies Last reply
      0
      • O originSH

        It's not called 'friend' in C# it's 'internal'. 'internal' means any class in the same assembly can access it. 'protected' means any class that any inheriting class can access it. 'internal protected' (or 'protected internal' ;) ) means that any class in the same assembly AND any inheriting class can access it. In .Net 2.0 you can have 'friend' assemblies. If you make an assembly a 'friend' of another then it will have access to anything marked internal as if it was in the same assembly. MSDN: Access Modifiers[^] MSDN: Friend Assemblies[^]

        P Offline
        P Offline
        pavanteja
        wrote on last edited by
        #3

        thanks, some what i have cleared..

        pavan...

        1 Reply Last reply
        0
        • O originSH

          It's not called 'friend' in C# it's 'internal'. 'internal' means any class in the same assembly can access it. 'protected' means any class that any inheriting class can access it. 'internal protected' (or 'protected internal' ;) ) means that any class in the same assembly AND any inheriting class can access it. In .Net 2.0 you can have 'friend' assemblies. If you make an assembly a 'friend' of another then it will have access to anything marked internal as if it was in the same assembly. MSDN: Access Modifiers[^] MSDN: Friend Assemblies[^]

          S Offline
          S Offline
          Sonia Gupta
          wrote on last edited by
          #4

          if u please explain it a little bit with an example.that explains the limit of using there modifiers Thanks You.

          Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

          O P 3 Replies Last reply
          0
          • S Sonia Gupta

            if u please explain it a little bit with an example.that explains the limit of using there modifiers Thanks You.

            Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

            O Offline
            O Offline
            originSH
            wrote on last edited by
            #5

            If theres any part of what I said that you don't understand go and buy a book on C#. Inheritance and assemblies are all very basic concepts and you need to understand the basics well if you want to use C# to it's full extent.

            1 Reply Last reply
            0
            • S Sonia Gupta

              if u please explain it a little bit with an example.that explains the limit of using there modifiers Thanks You.

              Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

              P Offline
              P Offline
              pavanteja
              wrote on last edited by
              #6

              Protected internal ………meaning is protected or internal…which is selected by including Both a protected and an internal modifier in the member declaration. The intuitive meaning of protected internal is “access limited to this program or types derived from the containing class. Protected internal is a union of protected and internal in terms of providing access but not restricting. Meaning Inherited types, even though they belong to a different assembly, have access to the protected internal members Types that reside in the same assembly, even if they are not derived from the type; also have access to the protected internal members

              pavan...

              1 Reply Last reply
              0
              • S Sonia Gupta

                if u please explain it a little bit with an example.that explains the limit of using there modifiers Thanks You.

                Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

                P Offline
                P Offline
                pavanteja
                wrote on last edited by
                #7

                do u have any idea abt satellite assembly?:laugh:

                pavan...

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups