Defining "Type" in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Haab
    New Member
    • Mar 2008
    • 1

    Defining "Type" in C#

    What is the definition of "Type" in C#.Net? I know int, class etc are example s of f "Type" but could not decsribe what type is.

    Haab
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    "Everything is a type." (roughly)
    If you make your own class, called "SomeClass" then "SomeClass" becomes a type.

    Comment

    • balabaster
      Recognized Expert Contributor
      • Mar 2007
      • 798

      #3
      Originally posted by Plater
      "Everything is a type." (roughly)
      If you make your own class, called "SomeClass" then "SomeClass" becomes a type.
      In layman's terms - the term "type" is defined as the generic identifier that is appended to an object holding a certain type of data. It allows us to easily identify the format of data within that object so that we can easily store and retrieve values relevant to that object.

      For instance, we know that an object of type integer holds a whole numeric number between the values of -2147483648 and 2147483647; an object of type string holds some alphanumeric value etc; a phone number has an area code, a numbering plan area and the four digit phone number, each of which holds some numeric value etc.

      I'm at a loss to pin down anything more concise than that. If that shows up verbatim in your homework I won't be impressed :oP

      Comment

      Working...