diff --git a/src/exercicses/ex_a/HelloRunnable.java b/src/exercicses/ex_a/HelloRunnable.java new file mode 100644 index 0000000..2d76be3 --- /dev/null +++ b/src/exercicses/ex_a/HelloRunnable.java @@ -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"); + } +} diff --git a/src/exercicses/ex_a/HelloThread.java b/src/exercicses/ex_a/HelloThread.java new file mode 100644 index 0000000..4aa5ad7 --- /dev/null +++ b/src/exercicses/ex_a/HelloThread.java @@ -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"); + } +} diff --git a/src/exercicses/ex_a/TestingSimpleThreads.java b/src/exercicses/ex_a/TestingSimpleThreads.java new file mode 100644 index 0000000..ac93172 --- /dev/null +++ b/src/exercicses/ex_a/TestingSimpleThreads.java @@ -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(); + } +}