Demonstrate #if, #endif, and #define

image_pdfimage_print

   

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Demonstrate #if, #endif, and #define. 
 
#define EXPERIMENTAL 
 
using System; 
 
public class Test1 { 
  public static void Main() { 
     
    #if EXPERIMENTAL 
      Console.WriteLine("Compiled for experimental version."); 
    #endif 
   
    Console.WriteLine("This is in all versions."); 
  } 
}