[2347] in java-interest

home help back first fref pref prev next nref lref last post

Re: main() routine

daemon@ATHENA.MIT.EDU (Chuck McManis)
Fri Sep 29 17:07:58 1995

Date: Fri, 29 Sep 1995 11:49:16 -0700
From: cmcmanis@scndprsn.eng.sun.com (Chuck McManis)
To: phil@bolthole.com
Cc: java-interest@java.Eng.Sun.COM


Argv[0] what the name of your program by convienence in C. It worked that way because
applications were these standalone things that had no notion of self nor did they
interact with anything else. In Java there isn't a very clear notion of an application,
only the notion of behaviours encapulated in objects. It is by convention on non-java only
systems that the interpreter looks for the method signature:
	public static void main(String [])
to invoke a method on loaded object. We could have built it so that the java command
syntax was:

	java <classname> <methodname> arg1, arg2, arg3, ...

So that an arbitrary method was started by that gets annoying really quickly.

The closest analog of argv[0] is (this.getClass()).getName();

--Chuck
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post