当前位置:编程学习 > JAVA >>

很急啊,两个小程序,求答案啊

1设计一个程序要求实现使用叠代器完成对集合的遍历
2使用gui和监听器计数完成1+1=2

--------------------编程问答-------------------- 百度上一搜一堆的。 --------------------编程问答-------------------- public class Person
{
  public static void mian(String args[]){
   ArrayList arr=new ArrayList();
   arr.add("张三");
   arr.add("李四");
   arr.add("王五");
   for(Iterator it=arr.iterator();it.hasNext();)
   {
       System.out.println(it.next());
   }  

 }
}
果然是小程序,(。。) --------------------编程问答-------------------- int Find(int array[], int  length, int value)  
{  
    if(NULL == array || 0 == length)  
        return -1;  
  
    for(int index = 0; index < length; index++){  
        System.out.println(array[index]);
        // 查找
        //if(value == array[index])  
        //    return index;  
        }  
    return -1;  
}   --------------------编程问答-------------------- 第一个是小之又小,
第二个对我有难度,没用java搞过gui

引用 2 楼 ldxfriend 的回复:
public class Person
{
  public static void mian(String args[]){
   ArrayList arr=new ArrayList();
   arr.add("张三");
   arr.add("李四");
   arr.add("王五");
   for(Iterator it=arr.iterator();it.has……

--------------------
http://www.qinglobo.com/qklist-4.htm
补充:Java ,  Java SE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,