feat: Add comprehensive examples from multithreading and hashing lectures

This commit is contained in:
2026-05-24 15:46:45 +03:30
parent 6583799d9e
commit 83746b88f6
13 changed files with 314 additions and 39 deletions
@@ -0,0 +1,26 @@
package lecture.multithreading.basics;
public class SleepExample {
public static void main(String[] args) {
System.out.println("starting program");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
for (int i = 1; i <= 10; i++) {
System.out.println("Count: " + i);
try {
Thread.sleep(1000); // 1 second stop
} catch (InterruptedException e) {
System.out.println("Thread terminated!");
}
}
System.out.println("End of program");
}
}