|
|
Which main() method
is executed?
So
if there are 2 (or more classes) and each has a main() method, how does Java decide which
main() method to execute?
The answer is that Java
will execute the main method in the class you provide to the run-time
interpreter.
So to run the main() method
in MyTriangle, enter:
if
there are several applications that have a main method, such as in
client/server applications. We will first run the application that is
being used, then the second application. The client program will attempt
to access a server - use a server, therefore the server program will run
first.
Back
to top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|
|