黑马程序员技术交流社区
标题:
静态代码块
[打印本页]
作者:
爱的泪水
时间:
2015-10-2 00:19
标题:
静态代码块
class Student {
static String schoolName;
}
public class Demo_9{
public static void main(String[] args) {
Student stu1=new Student();
Student stu2=new Student();
Student.schoolName="传智播客";
System.out.println("我的学校是"+stu1.schoolName);
System.out.println("我的学校是"+stu2.schoolName);
}
}
作者:
爱的泪水
时间:
2015-10-2 00:35
哈哈,有这资源真好!
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2