This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation | |
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration | |
@SpringBootApplication | |
public class FooApplication { | |
public static void main(String[] args) { | |
// Bootstrap the application | |
SpringApplication.run(FooApplication.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
ThreadPool pool = new ThreadPool(7); | |
for (int i = 0; i < 5; i++) { | |
Task task = new Task(i); | |
pool.execute(task); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomRentrantLock { | |
public static void main(String[] args) { | |
LockCustom LockCustom=new ReentrantLockCustom(); | |
MyRunnable myRunnable=new MyRunnable(LockCustom); | |
new Thread(myRunnable,"Thread-1").start(); | |
new Thread(myRunnable,"Thread-2").start(); | |
} | |
} |