标题:Exception in thread "main" java.lang.NoSuchMethodError求解决办法 ...
只看楼主
小白编程
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2015-6-5
结帖率:100%
 问题点数:0 回复次数:0 
Exception in thread "main" java.lang.NoSuchMethodError求解决办法
import java.util.*;
class Person
{
    private String name;
    Person(String name)
    {
        this.name = name;
    }
    String GetName()
    {
        return name;
    }
   
}
public class Text_11 {

    public static void main(String []args)
    {
        ArrayList<Person> p = new ArrayList<Person>();
        p.add(new Person("abc1"));
        p.add(new Person("abc2"));
        p.add(new Person("abc3"));
        printColl(p);
    }
    public static void printColl(ArrayList<Person> p)
    {
        Iterator it = p.iterator();
        while(it.hasNext())
        {
            System.out.println(it.next().toString());
        }
    }
}
Exception in thread "main" java.lang.NoSuchMethodError: Person.<init>(Ljava/lang/String;)V
    at Text_11.main(Text_11.java:20)
搜索更多相关主题的帖子: thread private public return import 
2015-07-12 21:25



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-455348-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.082030 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved