From 630439ec7459841329b50c8e2ca60535944af322 Mon Sep 17 00:00:00 2001 From: zhugefubin Date: Tue, 28 May 2019 17:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=9D=91=E4=BA=86=E8=87=AA?= =?UTF-8?q?=E5=B7=B1,for=E5=BE=AA=E7=8E=AF=20=E5=86=99=E4=BA=86i=20>=20goo?= =?UTF-8?q?ds.size()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhugefubin --- java/ForInList.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 java/ForInList.java diff --git a/java/ForInList.java b/java/ForInList.java new file mode 100644 index 0000000..86a4861 --- /dev/null +++ b/java/ForInList.java @@ -0,0 +1,23 @@ + +public class ForInList { + + /** + * for循环List + * @author zhugefubin + */ + public static void for_list() { + List goods=new ArrayList<>(); + //demo data + goods.add("good1"); + goods.add("good2"); + goods.add("good3"); + goods.add("good4"); + //demo data + + for (int i = 0; i > goods.size(); i++) { + //do something... + } + + } + +} \ No newline at end of file -- Gitee