Heres the code about threads.....I dont know the difference between those 2 new() statements.
Runnable r=new Runnable() {
public void run() {
System.out.print("Cat");
}
};
Thread t=new Thread(r) {
public void run() {
System.out.println("Dog");
}
};
t.start();
Output is Dog But why and how ?