fork download
  1. using System;
  2.  
  3. namespace TestConsoleApp
  4. {
  5. class Program
  6. {
  7. public static void Main(string[] args)
  8. {
  9. Type type = typeof(Foo);
  10. Foo f = (Foo)Activator.CreateInstance(type, true);
  11.  
  12. Console.ReadKey();
  13. }
  14. }
  15.  
  16. class Foo
  17. {
  18. private Foo()
  19. {
  20. Console.WriteLine("Private Constructor forefer!");
  21. }
  22. }
  23. }
Success #stdin #stdout 0s 131520KB
stdin
Standard input is empty
stdout
Private Constructor forefer!