fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. using System;
  7. namespace Solution
  8. {
  9. class Solution
  10. {
  11. static void Main(string[] args)
  12. {
  13. Stack st = new Stack();
  14. st.Push(1);
  15. st.Push(1.1);
  16. st.Push('z');
  17. stPush("Hello");
  18.  
  19. foreach (var e in st)
  20. {
  21. Console.WriteLine(e);
  22. }
  23. }
  24. }
  25. /* Name of the class has to be "Main" only if the class is public. */
  26. /*class Ideone
  27. {
  28. public static void main (String[] args) throws java.lang.Exception
  29. {
  30. // your code goes here
  31. }
  32. }*/
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:6: error: class, interface, or enum expected
using System;
^
Main.java:7: error: class, interface, or enum expected
using System.Collections;
^
Main.java:8: error: class, interface, or enum expected
namespace Solution
^
Main.java:20: error: ')' expected
			foreach (var e in st)
			            ^
Main.java:20: error: ';' expected
			foreach (var e in st)
			                    ^
5 errors
stdout
Standard output is empty