Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

1. C# 4.0 – kurz & gut > Typ-Grundlagen

Typ-Grundlagen

Ein Typ definiert die Vorlage für einen Wert. Ein Wert ist ein Speicherort, der durch eine Variable oder eine Konstante bezeichnet wird. Eine Variable steht für einen Wert, der sich ändern kann, während eine Konstante einen festen Wert darstellt. Wir haben in unserem ersten Programm eine lokale Variable namens x erzeugt:

static void Main()
{
  int x = 12 * 30;
  Console.WriteLine (x);
}

Alle Werte sind in C# Instanzen eines bestimmten Typs. Die Bedeutung eines Werts und die Menge an möglichen Werten, die eine Variable haben kann, wird durch ihren Typ bestimmt. Der Typ von x ist int.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial