posted 22 years ago
[CODE}
class MyRunnable implements Runnable
{
public static void main(String[] args)
{
new Thread( new MyRunnable(2) ).start();
}
public void run(int n)
{
for(int i=0; i<n; i++)
{
System.out.println("Hello World");
}
}
}
[/CODE]
I tried running this code, but it shows a compile time error saying that MyRunnable should be declared Abstract.
But there is no Abstract method in class MyRunnable???
Please explain..