Variables and Data Types       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers T...
Objectives       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training Company
Objectives• Understand how to create variables and assign  values          Learn More @ http://www.learnnowonline.com     ...
Objectives• Understand how to create variables and assign  values• Review the available data types and how they  are based...
Objectives• Understand how to create variables and assign  values• Review the available data types and how they  are based...
Objectives• Understand how to create variables and assign  values• Review the available data types and how they  are based...
Agenda     Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Agenda• Variables         Learn More @ http://www.learnnowonline.com              Copyright © by Application Developers Tr...
Agenda• Variables• Data Types         Learn More @ http://www.learnnowonline.com            Copyright © by Application Dev...
Agenda• Variables• Data Types• Converting from One Data Type to Another         Learn More @ http://www.learnnowonline.com...
Agenda•   Variables•   Data Types•   Converting from One Data Type to Another•   Operators           Learn More @ http://w...
Variables       Learn More @ http://www.learnnowonline.com            Copyright © by Application Developers Training Company
Variables• Computer programs manage information         Learn More @ http://www.learnnowonline.com            Copyright © ...
Variables• Computer programs manage information• Variables are a way to store information          Learn More @ http://www...
Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory      ...
Variables•   Computer programs manage information•   Variables are a way to store information•   Variables exist in memory...
Variables•   Computer programs manage information•   Variables are a way to store information•   Variables exist in memory...
Variables•   Computer programs manage information•   Variables are a way to store information•   Variables exist in memory...
Variables•   Computer programs manage information•   Variables are a way to store information•   Variables exist in memory...
Variables•   Computer programs manage information•   Variables are a way to store information•   Variables exist in memory...
Naming Variables      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Co...
Naming Variables• Variable names must         Learn More @ http://www.learnnowonline.com            Copyright © by Applica...
Naming Variables• Variable names must   Begin with an alphabetic character or an underscore          Learn More @ http://...
Naming Variables• Variable names must   Begin with an alphabetic character or an underscore   Contain only alphabetic ch...
Naming Variables• Variable names must   Begin with an alphabetic character or an underscore   Contain only alphabetic ch...
Naming Variables• Variable names must   Begin with an alphabetic character or an underscore   Contain only alphabetic ch...
Naming Variables• Variable names must   Begin with an alphabetic character or an underscore   Contain only alphabetic ch...
Declaring Variables       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Traini...
Declaring Variables• Use the Dim keyword to declare a variable and  allocate storage space for it in memory          Learn...
Declaring Variables• Use the Dim keyword to declare a variable and  allocate storage space for it in memory• Use the As cl...
Declaring Variables• Use the Dim keyword to declare a variable and  allocate storage space for it in memory• Use the As cl...
Declaring Variables       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Traini...
Declaring Variables• To declare a variable and allocate storage space  for it in memory, first specify the data type and  ...
Declaring Variables• To declare a variable and allocate storage space  for it in memory, first specify the data type and  ...
Variable Lifetime and Scope       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developer...
Variable Lifetime and Scope• Variable’s lifetime is length of time it is available           Learn More @ http://www.learn...
Variable Lifetime and Scope• Variable’s lifetime is length of time it is available    Variable declared in a procedure me...
Variable Lifetime and Scope• Variable’s lifetime is length of time it is available    Variable declared in a procedure me...
Variable Lifetime and Scope• Variable’s lifetime is length of time it is available    Variable declared in a procedure me...
Variable Lifetime and Scope• Variable’s lifetime is length of time it is available    Variable declared in a procedure me...
Agenda     Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Agenda• Variables          Learn More @ http://www.learnnowonline.com              Copyright © by Application Developers T...
Agenda• Variables• Data Types        Learn More @ http://www.learnnowonline.com           Copyright © by Application Devel...
Agenda• Variables• Data Types• Converting from One Data Type to Another         Learn More @ http://www.learnnowonline.com...
Agenda•   Variables•   Data Types•   Converting from One Data Type to Another•   Operators           Learn More @ http://w...
Data Types      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Data Types• All information has a type          Learn More @ http://www.learnnowonline.com             Copyright © by Appl...
Data Types• All information has a type• Type defines how information will be stored,  used, manipulated, and displayed    ...
Data Types• All information has a type• Type defines how information will be stored,  used, manipulated, and displayed• .N...
Data Types• All information has a type• Type defines how information will be stored,  used, manipulated, and displayed• .N...
Integer Data Types      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training ...
Integer Data Types• SByte – based on System.SByte         Learn More @ http://www.learnnowonline.com            Copyright ...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127          Learn More @ http:...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types• SByte – based on System.SByte   Signed 8-bit integer between -128 and 127• Byte – based on System.Byt...
Integer Data Types      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training ...
Integer Data Types• Integer – based on System.Int32         Learn More @ http://www.learnnowonline.com            Copyrigh...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647         ...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• UIntege...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• UIntege...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• UIntege...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• UIntege...
Integer Data Types• Integer – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• UIntege...
Integer Data Types      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training ...
Integer Data Types• sbyte – based on System.SByte         Learn More @ http://www.learnnowonline.com            Copyright ...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127          Learn More @ http:...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types• sbyte – based on System.SByte   Signed 8-bit integer between -128 and 127• byte – based on System.Byt...
Integer Data Types      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training ...
Integer Data Types• int – based on System.Int32          Learn More @ http://www.learnnowonline.com             Copyright ...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647          Lea...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• uint – base...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• uint – base...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• uint – base...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• uint – base...
Integer Data Types• int – based on System.Int32   32-bit integer between -2,147,483,648 and    2,147,483,647• uint – base...
Choosing an Integer Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developer...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store          Learn More @ h...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developer...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store          Learn More @ h...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Choosing an Integer Data Type• Choose a data type that is appropriate for the  data you will store• Balance memory require...
Integer Data Types Fields and Methods          Learn More @ http://www.learnnowonline.com             Copyright © by Appli...
Integer Data Types Fields and Methods   • MinValue and MaxValue represent low and     high end of range of values         ...
Integer Data Types Fields and Methods   • MinValue and MaxValue represent low and     high end of range of values   • ToSt...
Integer Data Types Fields and Methods   • MinValue and MaxValue represent low and     high end of range of values   • ToSt...
Floating-Point Data Types       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers ...
Floating-Point Data Types• Single – based on System.Single           Learn More @ http://www.learnnowonline.com           ...
Floating-Point Data Types• Single – based on System.Single    32-bit single-precision floating point number between -3.40...
Floating-Point Data Types• Single – based on System.Single    32-bit single-precision floating point number between -3.40...
Floating-Point Data Types• Single – based on System.Single    32-bit single-precision floating point number between -3.40...
Floating-Point Data Types• Single – based on System.Single    32-bit single-precision floating point number between -3.40...
Floating-Point Data Types       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers ...
Floating-Point Data Types• float – based on System.Single           Learn More @ http://www.learnnowonline.com            ...
Floating-Point Data Types• float – based on System.Single    32-bit single-precision floating point number between -3.402...
Floating-Point Data Types• float – based on System.Single    32-bit single-precision floating point number between -3.402...
Floating-Point Data Types• float – based on System.Single    32-bit single-precision floating point number between -3.402...
Floating-Point Data Types• float – based on System.Single    32-bit single-precision floating point number between -3.402...
Decimal Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training C...
Decimal Data Type• Based on System.Decimal         Learn More @ http://www.learnnowonline.com            Copyright © by Ap...
Decimal Data Type• Based on System.Decimal   128-bit number between    -79,228,162,514,264,337,593,543,950,335 and    79,...
Decimal Data Type• Based on System.Decimal    128-bit number between     -79,228,162,514,264,337,593,543,950,335 and     ...
Decimal Data Type• Based on System.Decimal   128-bit number between    -79,228,162,514,264,337,593,543,950,335 and    79,...
Decimal Data Type Fields and Methods          Learn More @ http://www.learnnowonline.com             Copyright © by Applic...
Decimal Data Type Fields and Methods   • Truncate returns integer part and discards     fractional part             Learn ...
Decimal Data Type Fields and Methods   • Truncate returns integer part and discards     fractional part   • Round rounds t...
Decimal Data Type Fields and Methods   • Truncate returns integer part and discards     fractional part   • Round rounds t...
Decimal Data Type Fields and Methods   • Truncate returns integer part and discards     fractional part   • Round rounds t...
Char Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Comp...
Char Data Type• Based on System.Char         Learn More @ http://www.learnnowonline.com            Copyright © by Applicat...
Char Data Type• Based on System.Char   16-bit numeric value between 0 to 65535          Learn More @ http://www.learnnowo...
Char Data Type• Based on System.Char   16-bit numeric value between 0 to 65535• Holds code points, or character codes,  r...
Char Data Type• Based on System.Char   16-bit numeric value between 0 to 65535• Holds code points, or character codes,  r...
Char Data Type Methods      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Train...
Char Data Type Methods• ConvertFromUtf32 returns Unicode character  associated with code point         Learn More @ http:/...
Char Data Type Methods• ConvertFromUtf32 returns Unicode character  associated with code point• ConvertToUtf32 returns cod...
Char Data Type Methods      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Train...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed            Learn More @ http://www.le...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
Char Data Type Methods• IsControl indicates if a tab, carriage return, or line  feed• IsDigit indicates if a decimal digit...
String Data Type       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training ...
String Data Type• Based on System.String         Learn More @ http://www.learnnowonline.com            Copyright © by Appl...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters           Learn More @ http:/...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters• To include quotation marks i...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters• To include quotation marks i...
Boolean Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training C...
Boolean Data Type• Based on System.Boolean         Learn More @ http://www.learnnowonline.com            Copyright © by Ap...
Boolean Data Type• Based on System.Boolean   0 (True) or 1 (False)           Learn More @ http://www.learnnowonline.com  ...
Boolean Data Type• Based on System.Boolean   0 (True) or 1 (False)• Used to test conditions           Learn More @ http:/...
Boolean Data Type• Based on System.Boolean     0 (True) or 1 (False)• Used to test conditionsIf firstVariable > secondVari...
Date Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Comp...
Date Data Type• Based on System.DateTime         Learn More @ http://www.learnnowonline.com            Copyright © by Appl...
Date Data Type• Based on System.DateTime   64 bit values representing dates ranging from    01/01/0001 through 12/31/9999...
Date Data Type• Based on System.DateTime   64 bit values representing dates ranging from    01/01/0001 through 12/31/9999...
Date Data Type• Based on System.DateTime   64 bit values representing dates ranging from    01/01/0001 through 12/31/9999...
Date Data Type• Based on System.DateTime   64 bit values representing dates ranging from    01/01/0001 through 12/31/9999...
Date Data Type• Based on System.DateTime   64 bit values representing dates ranging from    01/01/0001 through 12/31/9999...
String Data Type       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training ...
String Data Type• Based on System.String         Learn More @ http://www.learnnowonline.com            Copyright © by Appl...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters           Learn More @ http:/...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters• Use escape sequence () or pr...
String Data Type• Based on System.String   Represents a series of 0 to 2 billion characters• Use escape sequence () or pr...
Bool Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Comp...
Bool Data Type• Based on System.Boolean         Learn More @ http://www.learnnowonline.com            Copyright © by Appli...
Bool Data Type• Based on System.Boolean   0 (True) or 1 (False)           Learn More @ http://www.learnnowonline.com     ...
Bool Data Type• Based on System.Boolean   0 (True) or 1 (False)• Used to test conditions           Learn More @ http://ww...
Bool Data Type• Based on System.Boolean     0 (True) or 1 (False)• Used to test conditionsif (firstVariable > secondVariab...
Object Data Type      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Co...
Object Data Type• Based on System.Object         Learn More @ http://www.learnnowonline.com            Copyright © by Appl...
Object Data Type• Based on System.Object• Can contain any data type, including another  object          Learn More @ http:...
Object Data Type• Based on System.Object• Can contain any data type, including another  object• Use GetType to determine w...
Object Data Type• Based on System.Object• Can contain any data type, including another  object• Use GetType to determine w...
Agenda     Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Agenda• Variables          Learn More @ http://www.learnnowonline.com              Copyright © by Application Developers T...
Agenda• Variables• Data Types         Learn More @ http://www.learnnowonline.com            Copyright © by Application Dev...
Agenda• Variables• Data Types• Converting from One Data Type to  Another        Learn More @ http://www.learnnowonline.com...
Agenda• Variables• Data Types• Converting from One Data Type to  Another• Constants, Enumerations, and Structures         ...
Agenda• Variables• Data Types• Converting from One Data Type to  Another• Constants, Enumerations, and Structures• Operato...
Converting to Another Data Type       Learn More @ http://www.learnnowonline.com          Copyright © by Application Devel...
Converting to Another Data Type• Widening conversion         Learn More @ http://www.learnnowonline.com            Copyrig...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type• Widening conversion   New data type can store all of the values of the    original data ...
Converting to Another Data Type       Learn More @ http://www.learnnowonline.com          Copyright © by Application Devel...
Converting to Another Data Type• Use a conversion function          Learn More @ http://www.learnnowonline.com            ...
Converting to Another Data Type• Use a conversion function   shortValue = shortValue + CShort(byteValue)          Learn M...
Converting to Another Data Type• Use a conversion function   shortValue = shortValue + CShort(byteValue)• Convert class i...
Converting to Another Data Type• Use a conversion function   shortValue = shortValue + CShort(byteValue)• Convert class i...
Converting to Another Data Type• Use a conversion function   shortValue = shortValue + CShort(byteValue)• Convert class i...
Converting to Another Data Type• Use a conversion function   shortValue = shortValue + CShort(byteValue)• Convert class i...
Converting to Another Data Type         Learn More @ http://www.learnnowonline.com            Copyright © by Application D...
Converting to Another Data Type  • Use a cast operator            Learn More @ http://www.learnnowonline.com              ...
Converting to Another Data Type  • Use a cast operator     shortValue = (short)(shortValue + byteValue);            Learn...
Converting to Another Data Type  • Use a cast operator     shortValue = (short)(shortValue + byteValue);  • Convert class...
Converting to Another Data Type  • Use a cast operator     shortValue = (short)(shortValue + byteValue);  • Convert class...
Converting to Another Data Type  • Use a cast operator     shortValue = (short)(shortValue + byteValue);  • Convert class...
Converting to Another Data Type  • Use a cast operator     shortValue = (short)(shortValue + byteValue);  • Convert class...
Value Types and Reference Types         Learn More @ http://www.learnnowonline.com            Copyright © by Application D...
Value Types and Reference Types  • Value type variables directly store their values            Learn More @ http://www.lea...
Value Types and Reference Types  • Value type variables directly store their values      Stored in the stack, pool of mem...
Value Types and Reference Types  • Value type variables directly store their values      Stored in the stack, pool of mem...
Value Types and Reference Types  • Value type variables directly store their values      Stored in the stack, pool of mem...
Value Types and Reference Types         Learn More @ http://www.learnnowonline.com                                        ...
Value Types and Reference Types  • Reference type variables store a reference to    their values            Learn More @ h...
Value Types and Reference Types  • Reference type variables store a reference to    their values     Stored in the heap, ...
Value Types and Reference Types  • Reference type variables store a reference to    their values     Stored in the heap, ...
Value Types and Reference Types  • Reference type variables store a reference to    their values     Stored in the heap, ...
Value Types and Reference Types  • Reference type variables store a reference to    their values     Stored in the heap, ...
Value Types and Reference Types        Learn More @ http://www.learnnowonline.com           Copyright © by Application Dev...
Value Types and Reference Types • Boxing            Learn More @ http://www.learnnowonline.com               Copyright © b...
Value Types and Reference Types • Boxing    A value type is converted to a reference type            Learn More @ http://...
Value Types and Reference Types • Boxing    A value type is converted to a reference type    .NET Framework copies the v...
Value Types and Reference Types • Boxing    A value type is converted to a reference type    .NET Framework copies the v...
Value Types and Reference Types • Boxing    A value type is converted to a reference type    .NET Framework copies the v...
Value Types and Reference Types • Boxing    A value type is converted to a reference type    .NET Framework copies the v...
Constants      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Constants• Declared like variables          Learn More @ http://www.learnnowonline.com             Copyright © by Applicat...
Constants• Declared like variables• Value cannot be changed in code         Learn More @ http://www.learnnowonline.com    ...
Enumerations      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Enumerations• Collection of related constants          Learn More @ http://www.learnnowonline.com             Copyright © ...
Enumerations• Collection of related constants• Has a name and a numeric data type         Learn More @ http://www.learnnow...
Enumerations• Collection of related constants• Has a name and a numeric data type• Has a number of fields, each with a nam...
Structures       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training Company
Structures• Structures are user-defined data types          Learn More @ http://www.learnnowonline.com             Copyrig...
Structures• Structures are user-defined data types• Similar to enumerations in that they are a  collection of values      ...
Structures• Structures are user-defined data types• Similar to enumerations in that they are a  collection of values• Can ...
Structs          Learn More @ http://www.learnnowonline.com             Copyright © by Application Developers Training Com...
Structs• Structs are user-defined data types          Learn More @ http://www.learnnowonline.com             Copyright © b...
Structs• Structs are user-defined data types• Similar to enumerations in that they are a  collection of values          Le...
Structs• Structs are user-defined data types• Similar to enumerations in that they are a  collection of values• Can contai...
Agenda     Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Agenda• Variables          Learn More @ http://www.learnnowonline.com              Copyright © by Application Developers T...
Agenda• Variables• Data Types         Learn More @ http://www.learnnowonline.com            Copyright © by Application Dev...
Agenda• Variables• Data Types• Converting from One Data Type to Another         Learn More @ http://www.learnnowonline.com...
Agenda•   Variables•   Data Types•   Converting from One Data Type to Another•   Operators           Learn More @ http://w...
Operators      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Company
Operators• Perform an action on one or more values and  return the result of the operation         Learn More @ http://www...
Operators• Perform an action on one or more values and  return the result of the operation   Arithmetic operators        ...
Operators• Perform an action on one or more values and  return the result of the operation   Arithmetic operators   Stri...
Operators• Perform an action on one or more values and  return the result of the operation   Arithmetic operators   Stri...
Operators• Perform an action on one or more values and  return the result of the operation     Arithmetic operators     ...
Operators• Perform an action on one or more values and  return the result of the operation     Arithmetic operators     ...
Operators• Perform an action on one or more values and  return the result of the operation     Arithmetic operators     ...
Arithmetic Operators       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Train...
Arithmetic Operators• Perform basic arithmetic on one or more variables           Learn More @ http://www.learnnowonline.c...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
Arithmetic Operators• Perform basic arithmetic on one or more variables    + adds two numbers or converts a negative numb...
String Operators       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string         Learn More ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string• Use Like to determ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string• Use Like to determ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string• Use Like to determ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string• Use Like to determ...
String Operators• & and + operators concatenate, or add, two  strings together to produce a new string• Use Like to determ...
Assignment Operators      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Trainin...
Assignment Operators• Perform similar operations as arithmetic  operators          Learn More @ http://www.learnnowonline....
Assignment Operators• Perform similar operations as arithmetic  operators   += adds two numbers or converts a negative   ...
Assignment Operators• Perform similar operations as arithmetic  operators   += adds two numbers or converts a negative   ...
Assignment Operators• Perform similar operations as arithmetic  operators   += adds two numbers or converts a negative   ...
Assignment Operators• Perform similar operations as arithmetic  operators   += adds two numbers or converts a negative   ...
Assignment Operators• Perform similar operations as arithmetic  operators   += adds two numbers or converts a negative   ...
Comparison Operators      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Trainin...
Comparison Operators• Used to compare two values         Learn More @ http://www.learnnowonline.com            Copyright ©...
Comparison Operators• Used to compare two values   = returns true if two values are equal          Learn More @ http://ww...
Comparison Operators• Used to compare two values   = returns true if two values are equal   <> returns true if two value...
Comparison Operators• Used to compare two values   = returns true if two values are equal   <> returns true if two value...
Comparison Operators• Used to compare two values   = returns true if two values are equal   <> returns true if two value...
Comparison Operators• Used to compare two values   = returns true if two values are equal   <> returns true if two value...
Comparison Operators• Used to compare two values   = returns true if two values are equal   <> returns true if two value...
Logical Operators       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Training...
Logical Operators• Used to compare two expressions           Learn More @ http://www.learnnowonline.com              Copyr...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true             Learn Mor...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true    A Or B returns tr...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true    A Or B returns tr...
Logical Operators• Used to compare two expressions      A And B returns true if both A and B are true      A Or B return...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true    A Or B returns tr...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true    A Or B returns tr...
Logical Operators• Used to compare two expressions    A And B returns true if both A and B are true    A Or B returns tr...
Logical Operators• Used to compare two expressions      A And B returns true if both A and B are true      A Or B return...
Type Operators      Learn More @ http://www.learnnowonline.com         Copyright © by Application Developers Training Comp...
Type Operators• Test whether an object is of a particular data  type          Learn More @ http://www.learnnowonline.com  ...
Type Operators• Test whether an object is of a particular data  typeDim object1 As Objectobject1 = 7If TypeOf object1 Is I...
Arithmetic Operators       Learn More @ http://www.learnnowonline.com          Copyright © by Application Developers Train...
Arithmetic Operators• Perform basic arithmetic on one or more  variables          Learn More @ http://www.learnnowonline.c...
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
.NET Variables and Data Types
Upcoming SlideShare
Loading in …5
×

.NET Variables and Data Types

492 views
425 views

Published on

Understand how to create variables and assign values, and review the available data types and how they are based on the .NET Framework.

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
492
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • .NET Variables and Data Types

    1. 1. Variables and Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    2. 2. Objectives Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    3. 3. Objectives• Understand how to create variables and assign values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    4. 4. Objectives• Understand how to create variables and assign values• Review the available data types and how they are based on the .NET Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    5. 5. Objectives• Understand how to create variables and assign values• Review the available data types and how they are based on the .NET Framework• See how to convert a variable from one data type to another Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    6. 6. Objectives• Understand how to create variables and assign values• Review the available data types and how they are based on the .NET Framework• See how to convert a variable from one data type to another• Explore operators and how they can be used to change values and compare expressions Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    7. 7. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    8. 8. Agenda• Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    9. 9. Agenda• Variables• Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    10. 10. Agenda• Variables• Data Types• Converting from One Data Type to Another Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    11. 11. Agenda• Variables• Data Types• Converting from One Data Type to Another• Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    12. 12. Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    13. 13. Variables• Computer programs manage information Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    14. 14. Variables• Computer programs manage information• Variables are a way to store information Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    15. 15. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    16. 16. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory• Created at the start of programs or as needed Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    17. 17. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory• Created at the start of programs or as needed• Variables have three components Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    18. 18. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory• Created at the start of programs or as needed• Variables have three components  Data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    19. 19. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory• Created at the start of programs or as needed• Variables have three components  Data type  Name Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    20. 20. Variables• Computer programs manage information• Variables are a way to store information• Variables exist in memory• Created at the start of programs or as needed• Variables have three components  Data type  Name  Value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    21. 21. Naming Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    22. 22. Naming Variables• Variable names must Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    23. 23. Naming Variables• Variable names must  Begin with an alphabetic character or an underscore Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    24. 24. Naming Variables• Variable names must  Begin with an alphabetic character or an underscore  Contain only alphabetic characters, numbers, and underscores Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    25. 25. Naming Variables• Variable names must  Begin with an alphabetic character or an underscore  Contain only alphabetic characters, numbers, and underscores  Contain at least one alphabetic character or number if they begin with an underscore Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    26. 26. Naming Variables• Variable names must  Begin with an alphabetic character or an underscore  Contain only alphabetic characters, numbers, and underscores  Contain at least one alphabetic character or number if they begin with an underscore  Be less than 1,023 characters Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    27. 27. Naming Variables• Variable names must  Begin with an alphabetic character or an underscore  Contain only alphabetic characters, numbers, and underscores  Contain at least one alphabetic character or number if they begin with an underscore  Be less than 1,023 characters• Variable names should be descriptive and of reasonable length Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    28. 28. Declaring Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    29. 29. Declaring Variables• Use the Dim keyword to declare a variable and allocate storage space for it in memory Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    30. 30. Declaring Variables• Use the Dim keyword to declare a variable and allocate storage space for it in memory• Use the As clause to specify the variable’s data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    31. 31. Declaring Variables• Use the Dim keyword to declare a variable and allocate storage space for it in memory• Use the As clause to specify the variable’s data type Dim counter1 As Integer Dim counter2 As Integer = 612 Dim message1, message2, message3 As String message2 = "" message3 = "Hello" Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    32. 32. Declaring Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    33. 33. Declaring Variables• To declare a variable and allocate storage space for it in memory, first specify the data type and then specify the variable’s name Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    34. 34. Declaring Variables• To declare a variable and allocate storage space for it in memory, first specify the data type and then specify the variable’s name int counter1; int counter2 = 612; string message1, message2, message3; message2 = ""; message3 = "Hello"; Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    35. 35. Variable Lifetime and Scope Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    36. 36. Variable Lifetime and Scope• Variable’s lifetime is length of time it is available Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    37. 37. Variable Lifetime and Scope• Variable’s lifetime is length of time it is available  Variable declared in a procedure method will be in memory as long as that procedure method exists Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    38. 38. Variable Lifetime and Scope• Variable’s lifetime is length of time it is available  Variable declared in a procedure method will be in memory as long as that procedure method exists• Variable’s scope determines what code can reference it Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    39. 39. Variable Lifetime and Scope• Variable’s lifetime is length of time it is available  Variable declared in a procedure method will be in memory as long as that procedure method exists• Variable’s scope determines what code can reference it  Variable declared in a procedure method will be available only to that procedure method Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    40. 40. Variable Lifetime and Scope• Variable’s lifetime is length of time it is available  Variable declared in a procedure method will be in memory as long as that procedure method exists• Variable’s scope determines what code can reference it  Variable declared in a procedure method will be available only to that procedure method  Declare a variable at the class module level for it to be available to multiple procedures methods Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    41. 41. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    42. 42. Agenda• Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    43. 43. Agenda• Variables• Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    44. 44. Agenda• Variables• Data Types• Converting from One Data Type to Another Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    45. 45. Agenda• Variables• Data Types• Converting from One Data Type to Another• Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    46. 46. Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    47. 47. Data Types• All information has a type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    48. 48. Data Types• All information has a type• Type defines how information will be stored, used, manipulated, and displayed Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    49. 49. Data Types• All information has a type• Type defines how information will be stored, used, manipulated, and displayed• .NET Framework contains structures and classes that represent various types of data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    50. 50. Data Types• All information has a type• Type defines how information will be stored, used, manipulated, and displayed• .NET Framework contains structures and classes that represent various types of data• All data types in Visual Basic and C# are based on a .NET Framework structure or class Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    51. 51. Integer Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    52. 52. Integer Data Types• SByte – based on System.SByte Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    53. 53. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    54. 54. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    55. 55. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte  8-bit integer between 0 and 255 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    56. 56. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte  8-bit integer between 0 and 255• Short – based on System.Int16 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    57. 57. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte  8-bit integer between 0 and 255• Short – based on System.Int16  16-bit integer between -32,768 and 32,767 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    58. 58. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte  8-bit integer between 0 and 255• Short – based on System.Int16  16-bit integer between -32,768 and 32,767• UShort – based on System.Int16 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    59. 59. Integer Data Types• SByte – based on System.SByte  Signed 8-bit integer between -128 and 127• Byte – based on System.Byte  8-bit integer between 0 and 255• Short – based on System.Int16  16-bit integer between -32,768 and 32,767• UShort – based on System.Int16  16-bit unsigned integer between 0 and 65,535 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    60. 60. Integer Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    61. 61. Integer Data Types• Integer – based on System.Int32 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    62. 62. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    63. 63. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• UInteger – based on System.Int32 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    64. 64. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• UInteger – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    65. 65. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• UInteger – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• Long – based on System.Int64 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    66. 66. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• UInteger – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• Long – based on System.Int64  64-bit integer between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    67. 67. Integer Data Types• Integer – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• UInteger – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• Long – based on System.Int64  64-bit integer between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807• ULong – based on System.Int64 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    68. 68. Integer Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    69. 69. Integer Data Types• sbyte – based on System.SByte Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    70. 70. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    71. 71. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    72. 72. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte  8-bit integer between 0 and 255 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    73. 73. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte  8-bit integer between 0 and 255• short – based on System.Int16 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    74. 74. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte  8-bit integer between 0 and 255• short – based on System.Int16  16-bit integer between -32,768 and 32,767 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    75. 75. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte  8-bit integer between 0 and 255• short – based on System.Int16  16-bit integer between -32,768 and 32,767• ushort – based on System.Int16 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    76. 76. Integer Data Types• sbyte – based on System.SByte  Signed 8-bit integer between -128 and 127• byte – based on System.Byte  8-bit integer between 0 and 255• short – based on System.Int16  16-bit integer between -32,768 and 32,767• ushort – based on System.Int16  16-bit unsigned integer between 0 and 65,535 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    77. 77. Integer Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    78. 78. Integer Data Types• int – based on System.Int32 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    79. 79. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    80. 80. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• uint – based on System.Int32 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    81. 81. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• uint – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    82. 82. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• uint – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• long – based on System.Int64 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    83. 83. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• uint – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• long – based on System.Int64  64-bit integer between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    84. 84. Integer Data Types• int – based on System.Int32  32-bit integer between -2,147,483,648 and 2,147,483,647• uint – based on System.Int32  32-bit unsigned integer between 0 and 4,294,967,295• long – based on System.Int64  64-bit integer between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807• ulong – based on System.Int64 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    85. 85. Choosing an Integer Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    86. 86. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    87. 87. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    88. 88. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  Integer requires twice as much storage space (4 bytes) than Short (2 bytes) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    89. 89. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  Integer requires twice as much storage space (4 bytes) than Short (2 bytes)  Integer and Long are more efficient than Byte or Short because .NET Framework represents numbers as 32-bit or 64-bit values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    90. 90. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  Integer requires twice as much storage space (4 bytes) than Short (2 bytes)  Integer and Long are more efficient than Byte or Short because .NET Framework represents numbers as 32-bit or 64-bit values• Use Integer unless you have valid concerns about memory usage Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    91. 91. Choosing an Integer Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    92. 92. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    93. 93. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    94. 94. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  int requires twice as much storage space (4 bytes) than short (2 bytes) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    95. 95. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  int requires twice as much storage space (4 bytes) than short (2 bytes)  int and long are more efficient than Byte or short because .NET Framework represents numbers as 32- bit or 64-bit values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    96. 96. Choosing an Integer Data Type• Choose a data type that is appropriate for the data you will store• Balance memory requirement and performance  int requires twice as much storage space (4 bytes) than short (2 bytes)  int and long are more efficient than Byte or short because .NET Framework represents numbers as 32- bit or 64-bit values• Use int unless you have valid concerns about memory usage Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    97. 97. Integer Data Types Fields and Methods Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    98. 98. Integer Data Types Fields and Methods • MinValue and MaxValue represent low and high end of range of values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    99. 99. Integer Data Types Fields and Methods • MinValue and MaxValue represent low and high end of range of values • ToString returns string representation of value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    100. 100. Integer Data Types Fields and Methods • MinValue and MaxValue represent low and high end of range of values • ToString returns string representation of value  Specify format to control how string is displayed Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    101. 101. Floating-Point Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    102. 102. Floating-Point Data Types• Single – based on System.Single Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    103. 103. Floating-Point Data Types• Single – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    104. 104. Floating-Point Data Types• Single – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• Double – based on System.Double Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    105. 105. Floating-Point Data Types• Single – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• Double – based on System.Double  64-bit double-precision floating point number between -1.79769313486231570 x 10308 and -4.94065645841246544 / 10324 for negative values and between 4.94065645841246544 x 10324 and 1.79769313486231570 x 10308 for positive values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    106. 106. Floating-Point Data Types• Single – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• Double – based on System.Double  64-bit double-precision floating point number between -1.79769313486231570 x 10308 and -4.94065645841246544 / 10324 for negative values and between 4.94065645841246544 x 10324 and 1.79769313486231570 x 10308 for positive values• Use Double unless you have valid concerns about memory usage Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    107. 107. Floating-Point Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    108. 108. Floating-Point Data Types• float – based on System.Single Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    109. 109. Floating-Point Data Types• float – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    110. 110. Floating-Point Data Types• float – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• double – based on System.Double Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    111. 111. Floating-Point Data Types• float – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• double – based on System.Double  64-bit double-precision floating point number between -1.79769313486231570 x 10308 and -4.94065645841246544 / 10324 for negative values and between 4.94065645841246544 x 10324 and 1.79769313486231570 x 10308 for positive values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    112. 112. Floating-Point Data Types• float – based on System.Single  32-bit single-precision floating point number between -3.402823 x 1038 and -1.401298 / 1045 for negative values and 1.401298 / 1045 and 3.402823 x 1038 for positive values• double – based on System.Double  64-bit double-precision floating point number between -1.79769313486231570 x 10308 and -4.94065645841246544 / 10324 for negative values and between 4.94065645841246544 x 10324 and 1.79769313486231570 x 10308 for positive values• Use double unless you have valid concerns about memory usage Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    113. 113. Decimal Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    114. 114. Decimal Data Type• Based on System.Decimal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    115. 115. Decimal Data Type• Based on System.Decimal  128-bit number between -79,228,162,514,264,337,593,543,950,335 and 79,228,162,514,264,337,593,543,950,335 with no decimal places and between -7.9228162514264337593543950335 and 7.9228162514264337593543950335 with up to 28 decimal places Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    116. 116. Decimal Data Type• Based on System.Decimal  128-bit number between -79,228,162,514,264,337,593,543,950,335 and 79,228,162,514,264,337,593,543,950,335 with no decimal places and between -7.9228162514264337593543950335 and 7.9228162514264337593543950335 with up to 28 decimal places• Holds numbers of lesser magnitude than floating points, but with greater precision Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    117. 117. Decimal Data Type• Based on System.Decimal  128-bit number between -79,228,162,514,264,337,593,543,950,335 and 79,228,162,514,264,337,593,543,950,335 with no decimal places and between -7.9228162514264337593543950335 and 7.9228162514264337593543950335 with up to 28 decimal places• Holds numbers of lesser magnitude than floating points, but with greater precision• Use when you need the utmost in precision, Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    118. 118. Decimal Data Type Fields and Methods Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    119. 119. Decimal Data Type Fields and Methods • Truncate returns integer part and discards fractional part Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    120. 120. Decimal Data Type Fields and Methods • Truncate returns integer part and discards fractional part • Round rounds to nearest integer or to a specified number of decimal places Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    121. 121. Decimal Data Type Fields and Methods • Truncate returns integer part and discards fractional part • Round rounds to nearest integer or to a specified number of decimal places • Floor rounds to integer smaller than or equal to the value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    122. 122. Decimal Data Type Fields and Methods • Truncate returns integer part and discards fractional part • Round rounds to nearest integer or to a specified number of decimal places • Floor rounds to integer smaller than or equal to the value • Ceiling rounds to integer greater than or equal to the value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    123. 123. Char Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    124. 124. Char Data Type• Based on System.Char Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    125. 125. Char Data Type• Based on System.Char  16-bit numeric value between 0 to 65535 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    126. 126. Char Data Type• Based on System.Char  16-bit numeric value between 0 to 65535• Holds code points, or character codes, representing a single Unicode character Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    127. 127. Char Data Type• Based on System.Char  16-bit numeric value between 0 to 65535• Holds code points, or character codes, representing a single Unicode character  The first 128 code points, numbers 0 through 127, are the ASCII character set Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    128. 128. Char Data Type Methods Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    129. 129. Char Data Type Methods• ConvertFromUtf32 returns Unicode character associated with code point Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    130. 130. Char Data Type Methods• ConvertFromUtf32 returns Unicode character associated with code point• ConvertToUtf32 returns code point associated with Unicode character Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    131. 131. Char Data Type Methods Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    132. 132. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    133. 133. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    134. 134. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    135. 135. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    136. 136. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit• IsLower indicates if a lowercase letter Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    137. 137. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit• IsLower indicates if a lowercase letter• IsNumber indicates if a number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    138. 138. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit• IsLower indicates if a lowercase letter• IsNumber indicates if a number• IsPunctuation indicates if a punctuation mark Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    139. 139. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit• IsLower indicates if a lowercase letter• IsNumber indicates if a number• IsPunctuation indicates if a punctuation mark• IsSeparator indicates if a separator, such as a space Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    140. 140. Char Data Type Methods• IsControl indicates if a tab, carriage return, or line feed• IsDigit indicates if a decimal digit• IsLetter indicates if an alphabetic letter• IsLetterOrDigit indicates if a letter or digit• IsLower indicates if a lowercase letter• IsNumber indicates if a number• IsPunctuation indicates if a punctuation mark• IsSeparator indicates if a separator, such as a space• IsSymbol indicates if a symbol, such as a + or - Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    141. 141. String Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    142. 142. String Data Type• Based on System.String Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    143. 143. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    144. 144. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters• To include quotation marks in a string, use two in a row Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    145. 145. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters• To include quotation marks in a string, use two in a row  Dim greeting As String = "Hello ""Robert""" Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    146. 146. Boolean Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    147. 147. Boolean Data Type• Based on System.Boolean Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    148. 148. Boolean Data Type• Based on System.Boolean  0 (True) or 1 (False) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    149. 149. Boolean Data Type• Based on System.Boolean  0 (True) or 1 (False)• Used to test conditions Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    150. 150. Boolean Data Type• Based on System.Boolean  0 (True) or 1 (False)• Used to test conditionsIf firstVariable > secondVariable Then Console.WriteLine("{0} is greater than {1}", _ firstVariable, secondVariable)End If Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    151. 151. Date Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    152. 152. Date Data Type• Based on System.DateTime Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    153. 153. Date Data Type• Based on System.DateTime  64 bit values representing dates ranging from 01/01/0001 through 12/31/9999 and times from 12:00:00 AM (midnight) through 11:59:59.9999999 PM Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    154. 154. Date Data Type• Based on System.DateTime  64 bit values representing dates ranging from 01/01/0001 through 12/31/9999 and times from 12:00:00 AM (midnight) through 11:59:59.9999999 PM• Enclose the date within # characters Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    155. 155. Date Data Type• Based on System.DateTime  64 bit values representing dates ranging from 01/01/0001 through 12/31/9999 and times from 12:00:00 AM (midnight) through 11:59:59.9999999 PM• Enclose the date within # characters  Dim nextCentury As Date = #1/1/2100# Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    156. 156. Date Data Type• Based on System.DateTime  64 bit values representing dates ranging from 01/01/0001 through 12/31/9999 and times from 12:00:00 AM (midnight) through 11:59:59.9999999 PM• Enclose the date within # characters  Dim nextCentury As Date = #1/1/2100#• Must use M/d/yyyy format Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    157. 157. Date Data Type• Based on System.DateTime  64 bit values representing dates ranging from 01/01/0001 through 12/31/9999 and times from 12:00:00 AM (midnight) through 11:59:59.9999999 PM• Enclose the date within # characters  Dim nextCentury As Date = #1/1/2100#• Must use M/d/yyyy format• Consider using DateTime rather than Date Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    158. 158. String Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    159. 159. String Data Type• Based on System.String Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    160. 160. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    161. 161. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters• Use escape sequence () or preface the string with @ to include quotation marks and backslashes in strings Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    162. 162. String Data Type• Based on System.String  Represents a series of 0 to 2 billion characters• Use escape sequence () or preface the string with @ to include quotation marks and backslashes in strings  string greeting1 = "Hello " Robert""; string greeting2 = @"Hello "" Robert"""; Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    163. 163. Bool Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    164. 164. Bool Data Type• Based on System.Boolean Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    165. 165. Bool Data Type• Based on System.Boolean  0 (True) or 1 (False) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    166. 166. Bool Data Type• Based on System.Boolean  0 (True) or 1 (False)• Used to test conditions Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    167. 167. Bool Data Type• Based on System.Boolean  0 (True) or 1 (False)• Used to test conditionsif (firstVariable > secondVariable){ Console.WriteLine("{0} is greater than {1}", firstVariable, secondVariable);} Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    168. 168. Object Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    169. 169. Object Data Type• Based on System.Object Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    170. 170. Object Data Type• Based on System.Object• Can contain any data type, including another object Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    171. 171. Object Data Type• Based on System.Object• Can contain any data type, including another object• Use GetType to determine what type of data is stored Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    172. 172. Object Data Type• Based on System.Object• Can contain any data type, including another object• Use GetType to determine what type of data is stored• Contains a pointer to the value in memory, not actual data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    173. 173. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    174. 174. Agenda• Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    175. 175. Agenda• Variables• Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    176. 176. Agenda• Variables• Data Types• Converting from One Data Type to Another Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    177. 177. Agenda• Variables• Data Types• Converting from One Data Type to Another• Constants, Enumerations, and Structures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    178. 178. Agenda• Variables• Data Types• Converting from One Data Type to Another• Constants, Enumerations, and Structures• Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    179. 179. Converting to Another Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    180. 180. Converting to Another Data Type• Widening conversion Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    181. 181. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    182. 182. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    183. 183. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you• Narrowing conversion Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    184. 184. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you• Narrowing conversion  New data type cannot store all of the values of the original data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    185. 185. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you• Narrowing conversion  New data type cannot store all of the values of the original data type  Loss of data could result Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    186. 186. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you• Narrowing conversion  New data type cannot store all of the values of the original data type  Loss of data could result  Need to make the conversion in code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    187. 187. Converting to Another Data Type• Widening conversion  New data type can store all of the values of the original data type  Compiler will make the conversion for you• Narrowing conversion  New data type cannot store all of the values of the original data type  Loss of data could result  Need to make the conversion in code• Make your conversions explicitly in code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    188. 188. Converting to Another Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    189. 189. Converting to Another Data Type• Use a conversion function Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    190. 190. Converting to Another Data Type• Use a conversion function  shortValue = shortValue + CShort(byteValue) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    191. 191. Converting to Another Data Type• Use a conversion function  shortValue = shortValue + CShort(byteValue)• Convert class includes a conversion method for each data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    192. 192. Converting to Another Data Type• Use a conversion function  shortValue = shortValue + CShort(byteValue)• Convert class includes a conversion method for each data type  Convert.ToSingle(longValue) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    193. 193. Converting to Another Data Type• Use a conversion function  shortValue = shortValue + CShort(byteValue)• Convert class includes a conversion method for each data type  Convert.ToSingle(longValue)• Parse method converts a string to a data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    194. 194. Converting to Another Data Type• Use a conversion function  shortValue = shortValue + CShort(byteValue)• Convert class includes a conversion method for each data type  Convert.ToSingle(longValue)• Parse method converts a string to a data type  Single.Parse(longValue.ToString()) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    195. 195. Converting to Another Data Type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    196. 196. Converting to Another Data Type • Use a cast operator Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    197. 197. Converting to Another Data Type • Use a cast operator  shortValue = (short)(shortValue + byteValue); Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    198. 198. Converting to Another Data Type • Use a cast operator  shortValue = (short)(shortValue + byteValue); • Convert class includes a conversion method for each data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    199. 199. Converting to Another Data Type • Use a cast operator  shortValue = (short)(shortValue + byteValue); • Convert class includes a conversion method for each data type  Convert.ToSingle(longValue); Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    200. 200. Converting to Another Data Type • Use a cast operator  shortValue = (short)(shortValue + byteValue); • Convert class includes a conversion method for each data type  Convert.ToSingle(longValue); • Parse method converts a string to a data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    201. 201. Converting to Another Data Type • Use a cast operator  shortValue = (short)(shortValue + byteValue); • Convert class includes a conversion method for each data type  Convert.ToSingle(longValue); • Parse method converts a string to a data type  Single.Parse(longValue.ToString()); Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    202. 202. Value Types and Reference Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    203. 203. Value Types and Reference Types • Value type variables directly store their values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    204. 204. Value Types and Reference Types • Value type variables directly store their values  Stored in the stack, pool of memory allocated by runtime for value types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    205. 205. Value Types and Reference Types • Value type variables directly store their values  Stored in the stack, pool of memory allocated by runtime for value types  Declared in code and runtime allocates proper amount of memory for them Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    206. 206. Value Types and Reference Types • Value type variables directly store their values  Stored in the stack, pool of memory allocated by runtime for value types  Declared in code and runtime allocates proper amount of memory for them  Efficient because space has already been allocated on stack Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    207. 207. Value Types and Reference Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    208. 208. Value Types and Reference Types • Reference type variables store a reference to their values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    209. 209. Value Types and Reference Types • Reference type variables store a reference to their values  Stored in the heap, a pool of memory whose size is dynamic Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    210. 210. Value Types and Reference Types • Reference type variables store a reference to their values  Stored in the heap, a pool of memory whose size is dynamic  Value is stored in the stack, but variable stores a reference to a value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    211. 211. Value Types and Reference Types • Reference type variables store a reference to their values  Stored in the heap, a pool of memory whose size is dynamic  Value is stored in the stack, but variable stores a reference to a value  Reference is used to find a value each time a variable is accessed in code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    212. 212. Value Types and Reference Types • Reference type variables store a reference to their values  Stored in the heap, a pool of memory whose size is dynamic  Value is stored in the stack, but variable stores a reference to a value  Reference is used to find a value each time a variable is accessed in code  Less efficient than value types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    213. 213. Value Types and Reference Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    214. 214. Value Types and Reference Types • Boxing Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    215. 215. Value Types and Reference Types • Boxing  A value type is converted to a reference type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    216. 216. Value Types and Reference Types • Boxing  A value type is converted to a reference type  .NET Framework copies the value to the heap and returns a reference to the value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    217. 217. Value Types and Reference Types • Boxing  A value type is converted to a reference type  .NET Framework copies the value to the heap and returns a reference to the value • Unboxing Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    218. 218. Value Types and Reference Types • Boxing  A value type is converted to a reference type  .NET Framework copies the value to the heap and returns a reference to the value • Unboxing  A reference type is converted to a value type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    219. 219. Value Types and Reference Types • Boxing  A value type is converted to a reference type  .NET Framework copies the value to the heap and returns a reference to the value • Unboxing  A reference type is converted to a value type  NET Framework uses the reference to copy the value back into a value type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    220. 220. Constants Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    221. 221. Constants• Declared like variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    222. 222. Constants• Declared like variables• Value cannot be changed in code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    223. 223. Enumerations Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    224. 224. Enumerations• Collection of related constants Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    225. 225. Enumerations• Collection of related constants• Has a name and a numeric data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    226. 226. Enumerations• Collection of related constants• Has a name and a numeric data type• Has a number of fields, each with a name and a value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    227. 227. Structures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    228. 228. Structures• Structures are user-defined data types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    229. 229. Structures• Structures are user-defined data types• Similar to enumerations in that they are a collection of values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    230. 230. Structures• Structures are user-defined data types• Similar to enumerations in that they are a collection of values• Can contain any data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    231. 231. Structs Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    232. 232. Structs• Structs are user-defined data types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    233. 233. Structs• Structs are user-defined data types• Similar to enumerations in that they are a collection of values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    234. 234. Structs• Structs are user-defined data types• Similar to enumerations in that they are a collection of values• Can contain any data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    235. 235. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    236. 236. Agenda• Variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    237. 237. Agenda• Variables• Data Types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    238. 238. Agenda• Variables• Data Types• Converting from One Data Type to Another Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    239. 239. Agenda• Variables• Data Types• Converting from One Data Type to Another• Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    240. 240. Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    241. 241. Operators• Perform an action on one or more values and return the result of the operation Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    242. 242. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    243. 243. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators  String operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    244. 244. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators  String operators  Assignment operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    245. 245. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators  String operators  Assignment operators  Comparison operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    246. 246. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators  String operators  Assignment operators  Comparison operators  Logical operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    247. 247. Operators• Perform an action on one or more values and return the result of the operation  Arithmetic operators  String operators  Assignment operators  Comparison operators  Logical operators  Type operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    248. 248. Arithmetic Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    249. 249. Arithmetic Operators• Perform basic arithmetic on one or more variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    250. 250. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    251. 251. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    252. 252. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number  * multiplies two numbers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    253. 253. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number  * multiplies two numbers  / divides two numbers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    254. 254. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number  * multiplies two numbers  / divides two numbers  Mod divides two numbers and returns only the remainder of the result Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    255. 255. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number  * multiplies two numbers  / divides two numbers  Mod divides two numbers and returns only the remainder of the result  divides two numbers and returns only the integer part of the result Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    256. 256. Arithmetic Operators• Perform basic arithmetic on one or more variables  + adds two numbers or converts a negative number into a positive number  - subtracts two numbers or converts a positive number into a negative number  * multiplies two numbers  / divides two numbers  Mod divides two numbers and returns only the remainder of the result  divides two numbers and returns only the integer part of the result  ^ raises a number to the power of another number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    257. 257. String Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    258. 258. String Operators• & and + operators concatenate, or add, two strings together to produce a new string Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    259. 259. String Operators• & and + operators concatenate, or add, two strings together to produce a new string• Use Like to determine if a string matches a pattern Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    260. 260. String Operators• & and + operators concatenate, or add, two strings together to produce a new string• Use Like to determine if a string matches a pattern  Use a * in the pattern to match to zero or more characters Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    261. 261. String Operators• & and + operators concatenate, or add, two strings together to produce a new string• Use Like to determine if a string matches a pattern  Use a * in the pattern to match to zero or more characters  Use a ? in the pattern to match to any single character Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    262. 262. String Operators• & and + operators concatenate, or add, two strings together to produce a new string• Use Like to determine if a string matches a pattern  Use a * in the pattern to match to zero or more characters  Use a ? in the pattern to match to any single character  Use a # in the pattern to match to any single digit Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    263. 263. String Operators• & and + operators concatenate, or add, two strings together to produce a new string• Use Like to determine if a string matches a pattern  Use a * in the pattern to match to zero or more characters  Use a ? in the pattern to match to any single character  Use a # in the pattern to match to any single digit  Use a [] in the pattern to match to a list of Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    264. 264. Assignment Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    265. 265. Assignment Operators• Perform similar operations as arithmetic operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    266. 266. Assignment Operators• Perform similar operations as arithmetic operators  += adds two numbers or converts a negative number into a positive number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    267. 267. Assignment Operators• Perform similar operations as arithmetic operators  += adds two numbers or converts a negative number into a positive number  -= subtracts two numbers or converts a positive number into a negative number Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    268. 268. Assignment Operators• Perform similar operations as arithmetic operators  += adds two numbers or converts a negative number into a positive number  -= subtracts two numbers or converts a positive number into a negative number  *= multiplies two numbers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    269. 269. Assignment Operators• Perform similar operations as arithmetic operators  += adds two numbers or converts a negative number into a positive number  -= subtracts two numbers or converts a positive number into a negative number  *= multiplies two numbers  /= divides two numbers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    270. 270. Assignment Operators• Perform similar operations as arithmetic operators  += adds two numbers or converts a negative number into a positive number  -= subtracts two numbers or converts a positive number into a negative number  *= multiplies two numbers  /= divides two numbers  = divides two numbers and returns only the integer part of the result Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    271. 271. Comparison Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    272. 272. Comparison Operators• Used to compare two values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    273. 273. Comparison Operators• Used to compare two values  = returns true if two values are equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    274. 274. Comparison Operators• Used to compare two values  = returns true if two values are equal  <> returns true if two values are not equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    275. 275. Comparison Operators• Used to compare two values  = returns true if two values are equal  <> returns true if two values are not equal  > returns true if the first value is greater than the second Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    276. 276. Comparison Operators• Used to compare two values  = returns true if two values are equal  <> returns true if two values are not equal  > returns true if the first value is greater than the second  < returns true if the first value is less than the second Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    277. 277. Comparison Operators• Used to compare two values  = returns true if two values are equal  <> returns true if two values are not equal  > returns true if the first value is greater than the second  < returns true if the first value is less than the second  >= returns true if the first value is greater than or equal to the second Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    278. 278. Comparison Operators• Used to compare two values  = returns true if two values are equal  <> returns true if two values are not equal  > returns true if the first value is greater than the second  < returns true if the first value is less than the second  >= returns true if the first value is greater than or equal to the second  <= returns true if the first value is less than or equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    279. 279. Logical Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    280. 280. Logical Operators• Used to compare two expressions Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    281. 281. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    282. 282. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    283. 283. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    284. 284. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true  A Xor B returns true if either A or B is true, but both of them are not true Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    285. 285. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true  A Xor B returns true if either A or B is true, but both of them are not true  A AndAlso B returns true if both A and B are true. Does not evaluate B if A is not true. Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    286. 286. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true  A Xor B returns true if either A or B is true, but both of them are not true  A AndAlso B returns true if both A and B are true. Does not evaluate B if A is not true.  A OrElse B returns true if either A or B is true. Does not evaluate B if A is true. Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    287. 287. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true  A Xor B returns true if either A or B is true, but both of them are not true  A AndAlso B returns true if both A and B are true. Does not evaluate B if A is not true.  A OrElse B returns true if either A or B is true. Does not evaluate B if A is true.  A Is B returns true if A and B refer to the same object Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    288. 288. Logical Operators• Used to compare two expressions  A And B returns true if both A and B are true  A Or B returns true if either A or B is true  Not A returns true if A is not true  A Xor B returns true if either A or B is true, but both of them are not true  A AndAlso B returns true if both A and B are true. Does not evaluate B if A is not true.  A OrElse B returns true if either A or B is true. Does not evaluate B if A is true.  A Is B returns true if A and B refer to the same object  A IsNot B returns true if A and B do not refer to the same Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    289. 289. Type Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    290. 290. Type Operators• Test whether an object is of a particular data type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    291. 291. Type Operators• Test whether an object is of a particular data typeDim object1 As Objectobject1 = 7If TypeOf object1 Is Integer Then Console.WriteLine("object1 = 7 and is type Integer")End If Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    292. 292. Arithmetic Operators Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
    293. 293. Arithmetic Operators• Perform basic arithmetic on one or more variables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company

    ×