public class Initaitelphon { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Telphone phone=new Telphone(); //phone.sendmessage(); phone.screen=5.0f; phone.cpu=1.4f; phone.mem=2.0f //phone.sendmessage(); phone.call(); } }
public class Telphone { float screen; float cpu; float mem; void call(){ system.out.println("var:"+var); system.out.println("Telphone有打电话的功能"); } void sendMessage(){ System.out.println("var:"+var); System.out.println("screen"+screen+"cpu"+cpu+"mem"+mem+"Telphone有打电话的功能") } }
运行不了,显示 (找不到或无法加载主类 Initaitelphon)想知道我哪里出现了问题,谢谢老师!
jdk环境变量出了问题,试试重新配置
Java 的文件名 Initaitelphon 是不是写错了?最后面掉了一个“e”应为:Initailtelphone