create thread Anonymous inner class implements Runnable interface
package innerclass;
class Test{
public static void main(String arg[])
{
Runnable r=new Runnable()
{
public void run()
{
System.out.println("run");
}
};
Thread t=new Thread(r);
t.start();
}
}
output:
run
0 comments:
Post a Comment