JAVA-21-homework
2021-01-03 07:31
阅读:805
标签:add style practice ring rgs string alt span util
package practice; import java.util.*; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub show(); } public static void show() { Collectiona = new ArrayList (); a.add("欧欧 Q仔"); a.add("亚亚 Q妹"); a.add("菲菲 Q妹"); a.add("美美 Q妹"); System.out.println("共计有"+a.size()+"只企鹅"); System.out.println("分别是:"); for (int i = 0; i ) { System.out.println(((ArrayList ) a).get(i)); } a.remove("菲菲 Q妹"); a.remove("美美 Q妹"); System.out.println("删除之后还有"+a.size()+"只企鹅"); System.out.println("分别是:"); for (int i = 0; i ) { System.out.println(((ArrayList ) a).get(i)); } a.contains("美美 Q妹"); if(true) { System.out.println("集合中不包含美美的消息"); }else { System.out.println("集合中包含美美的消息"); } } }
JAVA-21-homework
标签:add style practice ring rgs string alt span util
原文地址:https://www.cnblogs.com/yunlan/p/12991786.html
上一篇:C语言入门
评论
亲,登录后才可以留言!