key here is to use volatile keyword

by using volatile keyword, it tells complier(the current thread) that variable might be modified by "outside"(like other thread or even some hardwares, etc) For here, By calling proc1.start(), processor works on other thread not main thread, while proc1.shutdown works on main thread, so adding volatile to guarantee to work. This program is to continuously  print "continue" until press "Enter" to stop the loop