CSharp examples for Custom Type:class
Class with one field, one constructor
using System;//from www. j a va2s .c o m public class Dog { private string Name; public Dog( string name ) { Name = name; } public void Speak( ) { Console.WriteLine( "Hello. My name is {0}", Name ); } } public class Simple { public static void Main( ) { Dog spot = new Dog( "spot" ); spot.Speak( ); } }