few simple questions related to C sharp

Last post 07-21-2006 10:20 PM by vcsjones. 1 replies.

Sort Posts:

  • few simple questions related to C sharp

    07-21-2006, 5:39 PM
    • Participant
      1,904 point Participant
    • tutus
    • Member since 01-07-2006, 9:20 AM
    • Posts 585
     

    1- Sometimes we use ( ) like in : Mydatatable.columns.add(….) and sometimes we use [] like in arrays. When do we use [] and when we use () in C#

    2- why do we use TypeOf() in C# and gettype in VB. any explanantion pls

    3- Sometimes string and sometimes upper "S" : String like in TypeOf(String). when do we use string and when do we use String

    Thank you

    Thanks a lot, I appreciate your taking the time to help me.
  • Re: few simple questions related to C sharp

    07-21-2006, 10:20 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 4:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs
    1. Use brackets when you want to create an array, like this is a string array "string[]" and use parentheses to call a method.
    2. typeof() get's a instance of a Type class when you pass it a class type, like typeof(string) is the same as StringInstance.GetType().
    3. No difference. They are alliases. lowercase is a keyword resolved at compile time.
    Cheers,
           Kevin Jones


Page 1 of 1 (2 items)