回复 7楼 冰镇柠檬汁儿
我试试了 保存是html的格式没有出错,保存了js格式就出现了错误
<html> <head> <script scr="library.js"></script> <title>客户端</title> </head> <body> <script> function moveon(){ var answer=confirm("准备好了吗?"); if(answer){ window.location="} } setTimeout(moveon,60000); </script> </body> </html>
package ch01; class B extends A//派生类 { public void print(){ System.out.println("子类中的print"); } public static void main(String[] args) { A a=new B(); a.print();//此处为什么调用的是类A的print()? B b=new B(); b.print(); } } class A//基类 { public A(){ System.out.println("调用父类构造方法!"); } public void print(){ System.out.println("类A中的print"); } }