Java SE——面向对象 static关键字的用法

static修饰属性和方法 static变量 —— 类属性(静态属性) class Dog{ String talk = "汪汪"; String name; int age; public void getInfo(){ System.out.println("姓名:"+this.name+",年龄:"+this.age+",叫声:"+this.t
相关文章
相关标签/搜索