Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

running a java class without main method

807589Aug 8 2008 — edited Aug 8 2008
hi...is there anyway that i can run a java program, which doesnt have a main method, from command prompt?
lets say that i have a class called "ABC" and xyz() is a method in that class...can i say something like

java ABC:xyz() or something like that so that xyz() gets executed?

for some reason...i cant have a main method...i gotta work through this xyz() method...

please help me..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2008
Added on Aug 8 2008
21 comments
1,306 views