nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

C# Programmer's Reference  

. Operator

The dot operator is used for member access.

name1 . name2

Where:

name1
A name.
name2
A name.

Remarks

For example, consider the following class:

class Simple 
{
   public int a;
   public void b()
   {
   }
}
Simple s = new Simple();

The variable s has two members, a and b; to access them, use the dot operator:

s.a = 6;   // assign to field a;
s.b();     // invoke member function b;

The dot is also used to form qualified names, names that specify the namespace or interface (for example) to which they belong.

System.Console.WriteLine("hello"); // class Console in namespace System

The using directive makes some name qualification optional:

using System;
...
System.Console.WriteLine("hello");
Console.WriteLine("hello");   // same thing

But when an identifier is ambiguous, it must be qualified:

using System;
using OtherSystem; // a namespace containing another Console class
...
System.Console.WriteLine( "hello" ); // must qualify Console

See Also

C# Operators | 7.5.4 Member access