Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 安装/配置/编译/环境  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main [Re:lxy0618]
mtdhwgij





发贴: 13
积分: 0
于 2006-05-19 22:42 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
同楼主,我也出现了同一个问题,即使是个简单的hello,world!也出现这种线程错误,现将错误提示输出:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Search.main(Search.java:13)
Press any key to continue...
这是源程序:

public class Search
{
  static int linearSearch(int a[],int key)
{
  for (int n=0;n<a.length;n++)
if (a[n]==key) return n;
return-1;
}
public static void main(String args[])
{
  int a[]={25,36,47,32,21,16};
int key=Integer.parseInt(args[0]);
int k=linearSearch (a,key);
if (k!=-1)
System.out.println("Found value in element"+k);
else
System.out.println("key"+key+"nou found");
}
}
使用的是JCreator软件同楼主




话题树型展开
人气 标题 作者 字数 发贴时间
35987 新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main lxy0618 474 2006-03-29 08:54
33900 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main JavaandC 537 2006-03-29 09:37
33246 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main mtdhwgij 286 2006-05-19 22:45
33147 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main zcjl 56 2006-05-19 23:54
33222 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main mtdhwgij 19 2006-05-20 21:20
33029 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main JavaandC 222 2006-05-21 09:12
33356 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main xuyan268 34 2006-05-21 21:59
33531 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main 心情跑车 11 2006-05-31 16:25
33956 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main lxy0618 102 2006-03-29 13:27
33753 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main JavaandC 108 2006-03-29 13:41
33731 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main 朱批 36 2006-03-29 17:42
34045 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main 莫言 68 2006-04-14 18:12
33629 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main sunjavaduke 164 2006-04-30 11:15
33423 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main kennye 49 2006-05-16 15:02
33342 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main why 191 2006-05-17 01:45
33190 Re:新手求教:Exception in thread "main" java.lang.NoSuchMethodError: main mtdhwgij 671 2006-05-19 22:42

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923