类似类中类的方法而已看看下面,编译一下,看看他生成的CLASS文件import java.io.*;
public class p77{ //定义主类
public static void main(String args[]){
new p77().output();
}
public p77(){} //主类的构造函数
public void output(){ //定义方法
Input myInput=new Input();
char c=myInput.getTheChar();
if(c>=65&c<=90||c>=97&c<=122)
System.out.println("it is a letter.the letter is :"+c);
else
System.out.println("it is not a letter.");
}
class Input{ //定义一个子类
public char getTheChar(){ //定义子类的方法
char c=0;
System.out.println("enter a character:");
try{
c=(char)System.in.read();
}catch(IOException e){};
return c;
}
}
}
public class p77{ //定义主类
public static void main(String args[]){
new p77().output();
}
public p77(){} //主类的构造函数
public void output(){ //定义方法
Input myInput=new Input();
char c=myInput.getTheChar();
if(c>=65&c<=90||c>=97&c<=122)
System.out.println("it is a letter.the letter is :"+c);
else
System.out.println("it is not a letter.");
}
class Input{ //定义一个子类
public char getTheChar(){ //定义子类的方法
char c=0;
System.out.println("enter a character:");
try{
c=(char)System.in.read();
}catch(IOException e){};
return c;
}
}
}
{
try
{
return Class.forName(class$);
}
catch(ClassNotFoundException forName)
{
throw new NoClassDefFoundError(forName.getMessage());
}
}请问这段代码有什么意义?
Class.java:135: class$ is reserved for internal use
static Class class$(String class$)
^
把class$改成class和c