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. intenal and internal protected

intenal and internal protected

Scheduled Pinned Locked Moved C#
questiontutorial
8 Posts 5 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.
  • S Offline
    S Offline
    Sonia Gupta
    wrote on last edited by
    #1

    Please explain me the use of keyword internal protected and internal with an example ?? what is the difference between internal protected and internal ?? Can construstor be declared internal protected/internal ?? why or why not???

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

    C P 2 Replies Last reply
    0
    • S Sonia Gupta

      Please explain me the use of keyword internal protected and internal with an example ?? what is the difference between internal protected and internal ?? Can construstor be declared internal protected/internal ?? why or why not???

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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      google broken ? internal means visible only within the current assembly. protected internal presumably means visible only to derived classes within the current assembly. Yes, you can make a constructor whatever you like. If it's protected, obviously only derived classes can be created, unless a factory method is provided.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      S V 2 Replies Last reply
      0
      • C Christian Graus

        google broken ? internal means visible only within the current assembly. protected internal presumably means visible only to derived classes within the current assembly. Yes, you can make a constructor whatever you like. If it's protected, obviously only derived classes can be created, unless a factory method is provided.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

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

        Sir actually , google too provides this much information.as far as any example is concerned that , upto this limit i can use the internal member vaiables, and till this limit , i can make use of internal protected. I mean if u provide any small example , any example.Please

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

        C 1 Reply Last reply
        0
        • S Sonia Gupta

          Sir actually , google too provides this much information.as far as any example is concerned that , upto this limit i can use the internal member vaiables, and till this limit , i can make use of internal protected. I mean if u provide any small example , any example.Please

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

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Is what you mean to ask, why would you use these things ? Internal is useful for things you want to hide, but which should be visible within a module. For example, if you have a seperate data layer class that you want to be visible only to the entity classes within your module. internal protected allows you to create a base class which is derived from within your module, but which clients of your module are unable to extend.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • C Christian Graus

            google broken ? internal means visible only within the current assembly. protected internal presumably means visible only to derived classes within the current assembly. Yes, you can make a constructor whatever you like. If it's protected, obviously only derived classes can be created, unless a factory method is provided.

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            Christian Graus wrote:

            protected internal presumably means visible only to derived classes within the current assembly.

            I knew I wasn't the only one. :doh: protected internal means it's visible everywhere within the same assembly *and* to all subclasses.

            Cheers, Vıkram.


            After all is said and done, much is said and little is done.

            1 Reply Last reply
            0
            • S Sonia Gupta

              Please explain me the use of keyword internal protected and internal with an example ?? what is the difference between internal protected and internal ?? Can construstor be declared internal protected/internal ?? why or why not???

              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

              '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. example for internal : If application contains 2 files Assembly1.cs, Assembly2.cs If the first file contains a class (base class) (i.e. in assembly1) The second file is in assembly2…. If u want to access the base class of assembly1 in assembly2 then u can’t access it…this is the concept of Internal… 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

              pavan...

              S O 2 Replies Last reply
              0
              • P pavanteja

                '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. example for internal : If application contains 2 files Assembly1.cs, Assembly2.cs If the first file contains a class (base class) (i.e. in assembly1) The second file is in assembly2…. If u want to access the base class of assembly1 in assembly2 then u can’t access it…this is the concept of Internal… 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

                pavan...

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

                Assembly1 means Assemblyinfo.cs

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

                1 Reply Last reply
                0
                • P pavanteja

                  '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. example for internal : If application contains 2 files Assembly1.cs, Assembly2.cs If the first file contains a class (base class) (i.e. in assembly1) The second file is in assembly2…. If u want to access the base class of assembly1 in assembly2 then u can’t access it…this is the concept of Internal… 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

                  pavan...

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

                  You could have atleast rewritten what I gave rather than plagiarizing[^] my answer word for word X|

                  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