added ex A
This commit is contained in:
parent
36734dc1b9
commit
83c2b10efa
8
src/exercicses/ex_a/HelloRunnable.java
Normal file
8
src/exercicses/ex_a/HelloRunnable.java
Normal 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");
|
||||
}
|
||||
}
|
8
src/exercicses/ex_a/HelloThread.java
Normal file
8
src/exercicses/ex_a/HelloThread.java
Normal 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");
|
||||
}
|
||||
}
|
8
src/exercicses/ex_a/TestingSimpleThreads.java
Normal file
8
src/exercicses/ex_a/TestingSimpleThreads.java
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user