public
Created

Starting without a main method

  • Download Gist
Application.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13
using System;
 
namespace Demo {
class Application {
static Application() {
String args = Environment.CommandLine;
Console.WriteLine("Called with arguments {0}", args);
Environment.Exit(0);
}
 
static void Main() { }
}
}
Application.java
Java
1 2 3 4 5 6 7 8 9
package demo;
 
class Application {
static {
final String args = System.getProperty("sun.java.command");
System.out.printf("Called with arguments: %s\n", args);
System.exit(0);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.