Lecture overview -- Keyboard shortcut: 'u'  Previous page: The Overall Picture -- Keyboard shortcut: 'p'  Next page: Declaration and Types -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Introduction to C# - slide 26 : 43

Declarations and Types
Option Strict On
Option Explicit On

Module DeclarationsDemo

    Sub Main()
        Dim ch As Char = "A"C     ' A character variable
        Dim b As Boolean = True   ' A boolean variable
        Dim i As Integer = 5      ' An integer variable (4 bytes)
        Dim s As Single = 5.5F    ' A floating point number (4 bytes)
        Dim d As Double = 5.5     ' A floating point number (8 bytes)
    End Sub

End Module
using System;

class DeclarationsDemo{

  public static void Main(){
    char ch = 'A';          // A character variable
    bool b = true;          // A boolean variable
    int i = 5;              // An integer variable (4 byges)
    float s = 5.5F;         // A floating point number (4 bytes)
    double d = 5.5 ;        // A floating point number (8 bytes) 
  }

}