请输出以下代码的执行顺序
java
复制代码
package com.example.demo;
public class ClassA {
// 静态变量
static int a = 10;
static int b;
// 静态代码块
static {
System.out.println("Static block A");
b = a * 2;
}
public static void functionA(){
System.out.println("Function A");
}
public ClassA() {
functionA();
System.out.println("ClassA constructor");
}
public static void main(String[] args) {
System.out.println("a = " + a);
System.out.println("b = " + b);
}
}
java
复制代码
package com.example.demo;
public class ClassB extends ClassA{
private static int a =12;
private static int b= 13;
static {
System.out.println("static block B");
}
public static void functionB(){
System.out.println("ClassB functionB");
}
public ClassB(){
functionB();
System.out.println("ClassB constructor");
}
public static void main(String[] args) {
new ClassB();
}
}