Family of Integers : Integer Family « Data Type « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C# / CSharp Tutorial » Data Type » Integer Family 
2. 3. 1. Family of Integers

C# defines nine integer types:

  1. char,
  2. byte,
  3. sbyte,
  4. short,
  5. ushort,
  6. int,
  7. uint,
  8. long,
  9. ulong.

char type is used for representing characters

The integer structures are

  1. Byte
  2. SByte
  3. Int16
  4. UInt16
  5. Int32
  6. UInt32
  7. Int64
  8. UInt64

The integer structures also define the following const fields:

  1. MaxValue
  2. MinValue

Methods Supported by the Integer Structures

MethodMeaning
public int CompareTo(object v)Returns 0 if the values are equal. Returns a negative value if the invoking object has a lower value. Returns a positive value if the invoking object has a greater value.
public override bool Equals(object v)Returns true if equal.
public override int GetHashCode()Returns the hash code.
public TypeCode GetTypeCode()Returns the TypeCode enumeration value. For example, for Int32, the type code is TypeCode.Int32.
public static retType Parse(string str)Parses the string.
public static retType Parse(string str,IFormatProvider fmtpvdr)Parse string using the culture-specific information provided by fmtpvdr.
public static retType Parse(string str, NumberStyles styles)Parse string using the style information provided by styles.
public static retType Parse(string str, NumberStyles styles,IFormatProvider fmtpvdr)Parse string using the style information provided by styles and the culture-specific format information provided by fmtpvdr.
public override string ToString()Convert value to string.
public string ToString(string format)Convert value to string as specified by the format string.
public stringToString(IFormatProvider fmtpvdr)Returns the string representation of the value of the invoking object using the culture-specific information.
public stringToString(string format,IFormatProvider fmtpvdr)Returns the string representation of the value of the invoking object using the culture-specific information and the format.


All of the integer structures implement the following interfaces:

  1. IComparable,
  2. IConvertible, and
  3. IFormattable.
2. 3. Integer Family
2. 3. 1. Family of Integers
2. 3. 2. Integer ranges
2. 3. 3. Use 'is' for int value type
w___w___w__._ja___v___a2___s__.co__m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.