| 1 | // 程序每隔半秒钟输出一次返回值(显示出返回值从 1 变成 2) |
| 2 | public class Test { |
| 3 | public static void main(String[] args) throws InterruptedException { |
| 4 | System.out.println(new TransClass().getNumber()); |
| 5 | int count = 0; |
| 6 | while (true) { |
| 7 | Thread.sleep(500); |
| 8 | count++; |
| 9 | int number = new TransClass().getNumber(); |
| 10 | System.out.println(number); |
| 11 | if (3 == number || count >= 10) { |
| 12 | break; |
| 13 | } |
| 14 | } |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected