首页 > 编程语言 > 详细

java代码块 学习

时间:2018-06-21 18:56:29      阅读:217      评论:0      收藏:0      [点我收藏+]
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(); } }

java代码块 学习

原文:http://blog.51cto.com/357712148/2131465

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!