Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Master Vs Slave (MainMethods)

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this problems been driving me nuts�
How to terminate a sub �main method� class, that was initiated by another, in this case Master �main method� class�
Best explained via example�
--------------------------------------
Say I have two pre-made Java programs that I felt could work nicely together...
1) A simple �Text Editor�
2) A �Dictionary Viewer�
Both written completely separately with their own main methods (you can start either independently), so the �Dictionary Viewer� class is a kind of module program, that can be started from the �Text Editor�, which is simply done via�
Dictionary foobar = new Dictionary();
Now say after one minute, I wont to automatically close down (terminate) the �Dictionary Viewer�, setting up a timer is easy, but what boggles me is how to kill the main method class �Dictionary ( )� which I initialized in my �Text Editor� ?

Note: I know of many solutions that require merging the two codes (or similar), but I need them to be as they are both main methods that can be run independently, but with one being able to initialize the other then shut it down.
Thanks,
eung e'ustov
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thread is a duplicate of this one. Please don't crosspost. Thanks.
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic