fork download
  1. import std.stdio;
  2.  
  3. MyClass mc;
  4. void main()
  5. {
  6. mc = new MyClass();
  7. testClass tc = new testClass();
  8. tc.foo();
  9.  
  10. }
  11.  
  12. class MyClass
  13. {
  14.  
  15. string x = "dima";
  16. static void say()
  17. {
  18. writeln("Say hello");
  19. }
  20.  
  21. }
  22.  
  23.  
  24. class testClass
  25. {
  26.  
  27. void foo ()
  28. {
  29. writeln("foo");
  30. mc.say();
  31. writeln(mc.x);
  32. }
  33.  
  34.  
  35.  
  36.  
  37. }
  38.  
  39.  
Success #stdin #stdout 0s 2672KB
stdin
Standard input is empty
stdout
foo
Say hello
dima