1A and 1B
This commit is contained in:
BIN
Multi.class
Normal file
BIN
Multi.class
Normal file
Binary file not shown.
9
Multi.java
Normal file
9
Multi.java
Normal file
@@ -0,0 +1,9 @@
|
||||
class Multi extends Thread{
|
||||
public void run(){
|
||||
System.out.println("thread is running..");
|
||||
}
|
||||
public static void main(String args[]){
|
||||
Multi t1 = new Multi();
|
||||
t1.start();
|
||||
}
|
||||
}
|
||||
BIN
ThreadExample1.class
Normal file
BIN
ThreadExample1.class
Normal file
Binary file not shown.
13
ThreadExample1.java
Normal file
13
ThreadExample1.java
Normal file
@@ -0,0 +1,13 @@
|
||||
public class ThreadExample1 extends Thread {
|
||||
public void run(){
|
||||
int a = 10;
|
||||
int b = 12;
|
||||
int result = a + b;
|
||||
System.out.println("Thread started running..");
|
||||
System.out.println("Sum of two numbers is: " + result);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
ThreadExample1 t1 = new ThreadExample1();
|
||||
t1.start();
|
||||
}
|
||||
}
|
||||
BIN
src/1A.png
Normal file
BIN
src/1A.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
src/1B.png
Normal file
BIN
src/1B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
2
src/Title.txt
Normal file
2
src/Title.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
1A. write a java code by extending thread class
|
||||
1B. write a java code
|
||||
Reference in New Issue
Block a user