源程序只这样的:
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