Struture 1 :
public class Runner {
public static void main(String[] args) {
Thread t1 = new Thread(new Thread(){
public void run() {
System.out.println("value :");
}
});
t1.start();
}
}
Structure 2 :
public class Runner {
public static void main(String[] args) {
Thread t1 = new Thread(){
public void run(){
System.out.println("value :");
}
};
t1.start();
}
}
Result in both the cases is same.
What is the difference between the two above mentioned structres? Please explain.