黑马程序员技术交流社区

标题: 一道面试题,看了一下午还是迷迷糊糊的,求大神给具体流程! [打印本页]

作者: 15863453752    时间: 2015-8-30 21:35
标题: 一道面试题,看了一下午还是迷迷糊糊的,求大神给具体流程!
class Student {
                        static {
                                System.out.println("Student 静态代码块");
                        }
                       
                        {
                                System.out.println("Student 构造代码块");
                        }
                       
                        public Student() {
                                System.out.println("Student 构造方法");
                        }
                }
       
                class Demo2_Student {
                        static {
                                System.out.println("Demo2_Student静态代码块");
                        }
                       
                        public static void main(String[] args) {
                                System.out.println("我是main方法");
                               
                                Student s1 = new Student();
                                Student s2 = new Student();
                        }
                }




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2