这是一道笔试题,请分析输出结果:注释里有我个人的理解public class Test { public static void main(String [] args) { A a1 = new A(); A a2 = new B(); //向上转型,多态 B b = new B(); C c = new C...
var a = '1986'; function fn() { console.log(a); var a = '1987'; console.log(a); } fn(); console.log(a); //函数声明提升优先于变量提升,函数声明会被变量赋值影响,但不会被变量声明影响 // var func = 10 .