java封装一个类PintASCHI, 其有一个功能方法print(), 通过一个参数int类型整数(0~128)得到该数代表的ASCI1码。例如传递参数97,得到字符为a.可以使用强制类型转换进行计了封装执行主类测试结果。
软件NetBeans IDE 7.0.1,需要单独写主类。
主类:
ComputerEquation c=new ComputerEquation();
c.conputerRoot(3,7,2);`
PintASCHI类:
public class PrintASCII {
public void print(int n){
char mychar;
mychar=(char)n;
System.out.println(mychar);
}
}