Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Testimonials Advertise Contact Us About Us Link to Us
Source Codes E-Books Downloads Jobs Web Hosting Chats

C# : C Sharp
Introduction to .NET
An Introduction To The .NET Framework
System Requirements
Application Types in C#
To Begin With C# Programming
.NET Type
Predefined Reference Types
Data types in C# and .NET
Classes and Object Model in .NET
Property in C# class
Method Overloading
C# Tutorial Namespaces
Interfaces
Delegates in C#
Events in C#
Reflection

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
Oops
Data Ware Housing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft FrontPage
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Computer Basics
Basics of Computer


Predefined Reference Types

home Next



Predefined Reference Types

The predefined reference types are object and string. The type object is the ultimate base type of all other types. The type string is used to represent Unicode string values. Values of type string are immutable.

Object
The ultimate base type of all other types object o = null;
string
String type; a string is a sequence of Unicode characters string s = "hello";



Predefined value types

The predefined value types include signed and unsigned integral types, floating-point types, and the types bool, char, and decimal. The signed integral types are sbyte, short, int, and long; the unsigned integral types are byte, ushort, uint, and ulong; and the floating-point types are float and double.

  • Eliminate a time wasters in life;
  • The Law of an Excluded Alternative;
  • Identify a major time-wasters;
  • Practical ways to overcome and avoid them if possible.
  • sbyte 8-bit signed integral type sbyte val = 12;

    short 16-bit signed integral type short val = 12;

    int 32-bit signed integral type int val = 12;

    long 64-bit signed integral type long val1 = 12;
    long val2 = 34L;

    byte 8-bit unsigned integral type byte val1 = 12;

    ushort 16-bit unsigned integral type ushort val1 = 12;

    uint 32-bit unsigned integral type uint val1 = 12;

    float Single-precision floating point type float val = 1.23F;

    double Double-precision floating point type double val1 = 1.23;

    double val2 = 4.56D;



    Bool

    The bool type is used to represent Boolean values: values that are either true or false. The inclusion of bool makes it easier to write self-documenting code, and also helps eliminate the all-too-common C++ coding error in which a developer mistakenly uses "=" when "==" should have been used. In C#, the example

    int i =…;
    F (i);
    if (i = 0) // the test should be (i == 0)
    G();
    results in a compile-time error because the expression i = 0 is of type int,
    and if statements require an expression of type bool.
    Boolean type;
    a bool value is either true or false
    bool val1 = true;
    bool val2 = false;



    char

    The char type is used to represent Unicode characters. A variable of type char represents a single 16-bit Unicode character. Character type; a char value is a Unicode character char val = 'h';




    Decimal

    The decimal type is appropriate for calculations in which rounding errors caused by floating point representations are unacceptable. Common examples include financial calculations such as tax computations and currency conversions. The decimal type provides 28 significant digits.

    Precise decimal type with 28 significant digits
    decimal val = 1.23M;

    Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32. As a matter of style, use of the keyword is favored over use of the complete system type name.

    Two expressions of type int are considered equal if they represent the same integer value. Two expressions of type object are considered equal if both refer to the same object, or if both are null. Two expressions of type string are considered equal if the string instances have identical lengths and identical characters in each character position, or if both are null.




    Differences Between Values Types and Reference Types.

    The following table shows some of the differences between values types and reference types.

    Value types Reference types
    Allocated on stack Allocated on heap
    A value type variable contains the data itself Reference type variable contains the address of memory location where data is actually stored
    When we copy a value type variable to another one, the actual data is copied and each variable can be independently manipulated. When copying a reference type variable to another variable, only the memory address is copied. Both variables will still point to the same memory location, which means, if we change one variable, the value will be changed for the other variable too.
    integer, float, boolean, double etc are value types. string and object are reference types.
    struct is value type. Classes and interfaces are reference types.

     Related C# : C Sharp Books
    C# From a Java Developer's Perspective
    C#
    .NET Book Zero
    C# Language Specification
    The Mono Handbook
    More Link » »
     
     C# : C Sharp FAQs
    What is the difference between typeof and GetType()?
    What is C#?
    How do I develop C# apps?
    Does C# replace C++?
    Does C# have its own class library?
    More Link » »
     
     C# : C Sharp Interview Questions
    What does the term immutable mean?
    What’s the difference between System.String and System.Text.StringBuilder classes?
    What’s the advantage of using System.Text.StringBuilder over System.String?
    What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
    What’s a multicast delegate?
    More Link » »
     
     C# : C Sharp Articles
    Abstract Factory Design Pattern Implementation in C#
    Manipulating Strings in c#
    Delegates and Events in C#
    Automatic Memory Management
    More Link » »
     
     C# : C Sharp News
    .NET TIP: Using .NET Reflector
    COMMENTARY--C# is a language for writing .NET applications.
    ReSharper 3.1 released, makes headway towards 4.0
    Microsoft to stop selling Windows XP on Monday
    News on Delegates and Events:
    More Link » »


    Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    • blinkbits
    • BlinkList
    • blogmarks
    • co.mments
    • connotea
    • del.icio.us
    • De.lirio.us
    • digg
    • Fark
    • feedmelinks
    • Furl
    • LinkaGoGo
    • Ma.gnolia
    • NewsVine
    • Netvouz
    • RawSugar
    • Reddit
    • scuttle
    • Shadows
    • Simpy
    • Smarking
    • Spurl
    • TailRank
    • Wists
    • YahooMyWeb

    home Next

    Keywords c# Predefined Reference Types, c++ reference, c# array, c# properties, c# property, c# using, c# string, reference format, c# c++, c# thread, msdn c#, c# value, c# object, c# method, get c#, system c#, string reference


    HTML Quizes
    HTML Quiz
    XHTML Quiz
    CSS Quiz
    TCP/IP Quiz
    CSS 1.0 Quiz
    CSS 2.0 Quiz
    XML Quizes
    XML Quiz
    XSL Quiz
    XSLT Quiz
    DTD Quiz
    Schema Quiz
    XForms Quiz
    XSL-FO Quiz
    XML DOM Quiz
    XLink Quiz
    XQuery Quiz
    XPath Quiz
    XPointer Quiz
    RDF Quiz
    SOAP Quiz
    WSDL Quiz
    RSS Quiz
    WAP Quiz
    Web Services Quiz
    Browser Scripting Quizes
    JavaScript Quiz
    VBScript Quiz
    DHTML Quiz
    HTML DOM Quiz
    WMLScript Quiz
    E4X Quiz
    Server Scripting Quizes
    ASP Quiz
    PERL Quiz
    SQL Quiz
    ADO Quiz
    CVS Quiz
    Python Quiz
    Apple Script Quiz
    PL/SQL Quiz
    SQL Server Quiz
    .NET (dotnet) Quizes
    Microsoft.Net Quiz
    ASP.Net Quiz
    .Net Mobile Quiz
    C# : C Sharp Quiz
    ADO.NET Quiz
    VB.NET Quiz
    VC++ Quiz
    Multimedia Quizes
    SVG Quiz
    Flash Quiz
    Media Quiz
    SMIL Quiz
    Photoshop Quiz
    Gimp Quiz
    Matlab Quiz
    Gnuplot Programming Quiz
    GIF Animation Quiz
    Scientific Visualization Quiz
    Graphics Quiz
    Web Building  Quizes
    Web Browsers Quiz
    Web Hosting Quiz
    W3C Quiz
    Web Building Quiz
    Web Quality Quiz
    Web Semantic Quiz
    Web Careers Quiz
    Weblogic Quiz
    SEO Quiz
    Web Site Hosting Quiz
    Domain Name Quiz
    Java Quizes
    Java Quiz
    JSP Quiz
    Servlets Quiz
    Struts Quiz
    EJB Quiz
    JMS Quiz
    JMX Quiz
    Eclipse Quiz
    J2ME Quiz
    JBOSS Quiz
    Programming Langauges Quizes
    C Quiz
    C++ Quiz
    Visual Basic Quiz
    Data Structures Using C Quiz
    Cobol Quiz
    Assembly Language Quiz
    Mainframe Quiz
    Forth Programming Quiz
    Lisp Programming Quiz
    Pascal Quiz
    Delphi Quiz
    Fortran Quiz
    Oops Quiz
    Data Ware Housing Quiz
    CGI Programming Quiz
    Emacs Quiz
    Gnome Quiz
    ILU Quiz
    Soft Skills Quizes
    Communication Skills Quiz
    Time Management Quiz
    Project Management Quiz
    Team Work Quiz
    Leadership Skills Quiz
    Corporate Communication Quiz
    Negotiation Skills Quiz
    Database Quizes
    Oracle Quiz
    MySQL Quiz
    Operating System Quizes
    BSD Quiz
    Symbian Quiz
    Unix Quiz
    Internet Quiz
    IP-Masquerading Quiz
    IPC Quiz
    MIDI Quiz
    Software Testing Quizes
    Testing Quiz
    Firewalls Quiz
    SAP Module Quizes
    ERP Quiz
    ABAP Quiz
    Business Warehousing Quiz
    SAP Basis Quiz
    Material Management Quiz
    Sales & Distribution Quiz
    Human Resource Quiz
    Netweaver Quiz
    Customer Relationship Management Quiz
    Production and Planning Quiz
    Networking Programming Quizes
    Corba Quiz
    Networking Quiz
    Microsoft Office Quizes
    Microsoft Word Quiz
    Microsoft Outlook Quiz
    Microsoft PowerPoint Quiz
    Microsoft Publisher Quiz
    Microsoft Excel Quiz
    Microsoft FrontPage Quiz
    Microsoft InfoPath Quiz
    Microsoft Access Quiz
    Accounting Quizes
    Financial Accounting Quiz
    Managerial Accounting Quiz
    Computer Basics Quizes
    Basics of Computer Quiz
    Copyright © 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
    Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Quick2Host | Quick2Host Mirror | Quick Site Kit | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
    Copyright © 2003-2009 Vyom Technosoft Pvt. Ltd., All Rights Reserved.