We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a38ef41 commit 0022483Copy full SHA for 0022483
src/main/java/multithread/OneThreadDemo.java
@@ -0,0 +1,20 @@
1
+package multithread;
2
+
3
+public class OneThreadDemo {
4
+ static class MeaninglessClass {
5
+ public void meaninglessMethod() {
6
+ System.out.println("In meaninglessMethod method now, current thread name is: " + Thread.currentThread().getName());
7
+ }
8
9
10
+ public static void main(String... args) {
11
+ /**This is to show that this program will guarantee to run in just one thread: main, there's no multi-threading here.*/
12
+ MeaninglessClass meaninglessClass = new MeaninglessClass();
13
+ meaninglessClass.meaninglessMethod();
14
15
16
17
18
+ System.out.println("Program finished.");
19
20
+}
0 commit comments