added ex A

This commit is contained in:
Louis Heredero 2024-12-09 15:04:59 +01:00
parent 36734dc1b9
commit 83c2b10efa
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package exercicses.ex_a;
public class HelloRunnable implements Runnable {
@Override
public void run() {
System.out.println("Hello from a class implementing the Runnable interface");
}
}

View File

@ -0,0 +1,8 @@
package exercicses.ex_a;
public class HelloThread extends Thread {
@Override
public void run() {
System.out.println("Hello from a class extending the Thread class");
}
}

View File

@ -0,0 +1,8 @@
package exercicses.ex_a;
public class TestingSimpleThreads {
public static void main(String[] args) {
new HelloThread().start();
new Thread(new HelloRunnable()).start();
}
}