Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

customize the entry point of program

 
pradeepta chopra
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
cant we customize the entry point of our program??
like we have main as the entry point for execution of our program.is there any way we can make some other method as the entry point of execution of our program??
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Do keep in mind that you are talking about programs executed from the command line. Other for example servlets or applets have different entry points.

Cheers,
Raj.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradeep,
I am curious..

What are you trying to do?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pradeepta chopra:
hi
cant we customize the entry point of our program??
like we have main as the entry point for execution of our program.is there any way we can make some other method as the entry point of execution of our program??
Apart from things like applets, which usually use init() and servlets, both as mentioned earlier, no. The JVM specifically looks for the main method with a particular signature, and will throw an Exception if it isn't found.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could write your own custom JVM launcher.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joanne Neal:
You could write your own custom JVM launcher.
. . . Only if you want me to move you off beginners, Joanne.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
. . . Only if you want me to move you off beginners, Joanne.


I did think twice about posting a reply. Decided to just put the idea out there without going into too much detail.
 
pradeepta chopra
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thank you al
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pradeepta chopra:
ok thank you al
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic