java多线程顺序打印one,two,three
之前面试的时候遇到过这么一道题,3个线程同时启动,要求按照 one, two, three的顺序打印,在这里记录一下如何实现,方法可能有点lowclass test { private static String[] ss = {"one", "two", "three"}; public static void main (String[] args){ Runnable r = new Runnable() { int flag = 0;
原创
2021-06-04 11:57:11 ·
662 阅读 ·
0 评论