import com.rigfort.wallet.server.ethereum.EthereumWallet; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes= Application.class) public class TesTest { @Test public void TestTs() throws InterruptedException { int[] num = {0,1,2,3,4,5,6}; for(int i =0; i<20; i++){ getNum(num); } } Integer i = 0; private Integer getNum(int[] nums) throws InterruptedException { int resNum = -1; i = (i % (nums.length)); Thread.sleep(1000); System.err.println("i:"+nums[i]); resNum = nums[i]; i++; return resNum; } }
【数组环形循环】
最新推荐文章于 2024-09-07 11:29:02 发布