我的代码是:-
class Test
{
static int a = 11;
static
{
System.out.println("Hello static! " + main() + a);
}
public static void main(String[]args)
{
System.out.println("Hello String!");
}
public static char main()
{
System.out.println("Hello char!");
return 'H';
}
}
输出:-
Hello char!
Hello static! H11
Hello String!
为什么是“你好 char!” 在“你好静态!”之前打印?