Friend & Protected keywords

Discussion in 'ASP .Net' started by dw, May 15, 2005.

  1. dw

    dw Guest

    Hi, everyone. I'm having difficulty understanding the difference of the
    keywords "friend" and "protected" vs. some of the other ways you can declare
    variables in ASP.NET ("dim", "public", and "static"). Can someone provide an
    example of where you'd use these keywords? Sorry for the newbie question.
    Thanks.
    dw, May 15, 2005
    #1
    1. Advertising

  2. These are more of VB.NET keywords, than asp.net ones.

    Friend == the object is accessible within the same assembly, class,
    depending on where you declare.

    Protected == The variables/objects declared with this are accessible within
    the same class, or any derived class. This is the midway between public
    (accessible by anyone) and private (accessible only within the class)

    More on VB.net keywords:

    http://msdn.microsoft.com/library/d...y/en-us/vblr7/html/vaorivblangkeywordsall.asp

    --
    Manohar Kamath
    Editor, .netBooks
    www.dotnetbooks.com


    "dw" <> wrote in message
    news:...
    > Hi, everyone. I'm having difficulty understanding the difference of the
    > keywords "friend" and "protected" vs. some of the other ways you can
    > declare variables in ASP.NET ("dim", "public", and "static"). Can someone
    > provide an example of where you'd use these keywords? Sorry for the newbie
    > question. Thanks.
    >
    Manohar Kamath, May 15, 2005
    #2
    1. Advertising

  3. dw

    dw Guest

    Thanks, Manohar. Now the keywords make sense.

    "Manohar Kamath" <> wrote in message
    news:...
    > These are more of VB.NET keywords, than asp.net ones.
    >
    > Friend == the object is accessible within the same assembly, class,
    > depending on where you declare.
    >
    > Protected == The variables/objects declared with this are accessible
    > within the same class, or any derived class. This is the midway between
    > public (accessible by anyone) and private (accessible only within the
    > class)
    >
    > More on VB.net keywords:
    >
    > http://msdn.microsoft.com/library/d...y/en-us/vblr7/html/vaorivblangkeywordsall.asp
    >
    > --
    > Manohar Kamath
    > Editor, .netBooks
    > www.dotnetbooks.com
    >
    >
    > "dw" <> wrote in message
    > news:...
    >> Hi, everyone. I'm having difficulty understanding the difference of the
    >> keywords "friend" and "protected" vs. some of the other ways you can
    >> declare variables in ASP.NET ("dim", "public", and "static"). Can someone
    >> provide an example of where you'd use these keywords? Sorry for the
    >> newbie question. Thanks.
    >>

    >
    >
    dw, May 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    2
    Views:
    556
    Andreas Klemt
    Jul 5, 2003
  2. Guest

    shared? protected? friend?

    Guest, Nov 29, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,405
    Scott Allen
    Nov 29, 2004
  3. MiG
    Replies:
    12
    Views:
    621
    Siddharth Jain
    Aug 12, 2007
  4. Rahul
    Replies:
    1
    Views:
    876
    Rahul
    Apr 7, 2008
  5. Peter
    Replies:
    2
    Views:
    272
    Öö Tiib
    Jun 6, 2013
Loading...

Share This Page