1A and 1B

This commit is contained in:
Aditya Tiwari
2026-01-23 14:09:56 +05:30
commit f2b4d16eff
7 changed files with 24 additions and 0 deletions

BIN
Multi.class Normal file

Binary file not shown.

9
Multi.java Normal file
View 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

Binary file not shown.

13
ThreadExample1.java Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
src/1B.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

2
src/Title.txt Normal file
View File

@@ -0,0 +1,2 @@
1A. write a java code by extending thread class
1B. write a java code