package com.twisters;
class MultiThreader extends thread implements Runnable{ /*15 additional char */
public void _run(){ /*1 additional character */
System.out.println( "STOP ME IF YOU CAN");
}
public static void main(String[] args) {
MultiThreader m = new MultiThreader();
Thread t = new Thread(m);
t.start();
}
}
The other way to prevent the code from running the main method itself is to throw an exception in a initializer which would do the trick too!!
My solution pick of the week - Vishwanath's Solution - I just love out of the Box Solutions!
Scores for this puzzle will be updated next week!!!
//2 class MultiThreader extends thread implements Runnable{ //
ReplyDeleteit is compilation error because there is no such class thread(Lower t in thread) exists . it is ok if there is a class "thread" in the package com.twisters
and because there is no run() method which is abstract method in Runnable interface it is again another compilation error