Hi,
I've been going through the Sun ePractice exams and had one question.
I don't understand why the following code would work without extending the
Thread class - any ideas?
Thanks
1. public class Snow {
2. public static void main(
String [] args) {
3. Snow s = new Snow();
4. new Thread() {
5. public void run() {
6. for (int w = 0; w < 2; w++) {
7. System.out.print(w);
8. }
9. }
10. }.start();
11. new Thread() {
12. public void run() {
13. for (int z = 5; z < 7; z++) {
14. System.out.print(z);
15. }
16. }
17. }.start();
18. }
19. }