Skip to content

Instantly share code, notes, and snippets.

@klmr
Created July 10, 2012 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klmr/3086189 to your computer and use it in GitHub Desktop.
Save klmr/3086189 to your computer and use it in GitHub Desktop.
Starting without a main method
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() { }
}
}
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment