Skip to content

Commit 6c96651

Browse files
committed
raise an exception in thread
1 parent 3113d4e commit 6c96651

File tree

6 files changed

+36
-31
lines changed

6 files changed

+36
-31
lines changed
0 Bytes
Binary file not shown.

TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java renamed to TecmaxPractise/src/com/tecmax/methodExamples/hello.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.tecmax.methodExamples;
22

3-
public class arraylist {
3+
public class hello {
44

55
}

TecmaxPractise/src/com/tecmax/methodExamples/swapingsring.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

TecmaxPractise/src/com/tecmax/methodExamples/swapstr.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

TecmaxPractise/src/com/tecmax/methodExamples/swapstring.java

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.tecmax.methodExamples;
2+
3+
public class thread2 extends Thread {
4+
5+
public void run()
6+
{
7+
try
8+
{
9+
10+
System.out.println ("Thread " +
11+
Thread.currentThread().getId() +
12+
" is running");
13+
14+
}
15+
catch (Exception e)
16+
{
17+
18+
System.out.println ("Exception is caught");
19+
}
20+
}
21+
}
22+
23+
24+
public class thread3
25+
{
26+
public static void main(String[] args)
27+
{
28+
int n =8;
29+
for (int i=0; i<8; i++)
30+
{
31+
thread2 object = new thread2();
32+
object.start();
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)