源程序只这样的:
public class Lesson51
{
int x;
int y;
public void prt1()
{
System.out.println("This is public prt1!");
}
private void prt2()
{
System.out.println("This is priviate prt2!");
}
protected void prt3()
{
System.out.println("this is protected prt3!");
}}class prtmn
{
public static void main(String [] args)
{
Lesson51 p11 = new Lesson51();
p11.prt1();
//p11.prt2();
p11.prt3();
}
}
这样运行:
E:\myjava\Lesson51>java Lesson51
Exception in thread "main" java.lang.NoSuchMethodError: mainclasspath是这样设置的:
.;C:\j2sdk1.4.2_04\lib\tools.jar
public class Lesson51
{
int x;
int y;
public void prt1()
{
System.out.println("This is public prt1!");
}
private void prt2()
{
System.out.println("This is priviate prt2!");
}
protected void prt3()
{
System.out.println("this is protected prt3!");
}}class prtmn
{
public static void main(String [] args)
{
Lesson51 p11 = new Lesson51();
p11.prt1();
//p11.prt2();
p11.prt3();
}
}
这样运行:
E:\myjava\Lesson51>java Lesson51
Exception in thread "main" java.lang.NoSuchMethodError: mainclasspath是这样设置的:
.;C:\j2sdk1.4.2_04\lib\tools.jar
解决方案 »
- log4j简单配置~(转) 希望对大家有用 新手喔
- java如何读取无符号的整型
- 关于文档创建
- 求车牌识别的过程。。。。。
- 关于继承的几点问题
- 求 :jbuider X 使用手册
- 用sun one studio,从java的tutorial下下来的程序,怎么还会有出错提示???
- 控制台读入字符串
- 精通java com口通讯的朋友请帮忙!解决问题马上给100分,欢迎大家讨论,分不够可以再加!
- 高手请帮帮忙,将万分感激!数据存不进数据库中,数据库中的数据查询不出来,这实在是件难受的事!!!!
- 中秋将至,散分,当发个红包给各个独在异乡闯荡的兄弟姐妹们,中秋节快乐!
- socket通讯问题!分不够在加!
如果确实需要用prtmn,需要把它作为public,或是在lesson的main中对其进行访问