static方法成员
来源:互联网 发布:淘宝一分钱秒杀怎么买 编辑:程序博客网 时间:2024/05/16 07:56
class person{
String name;
int age;
static String country;
public person(){}
public person(String name,int age){
this.name=name;
this.age=age;
}
public person(String name,int age,String country){
this.name=name;
this.age=age;
this.country=country;
}
public void show(){
System.out.println("姓名是:"+name+"年龄"+age+"国家"+country);
}
}
class persontest{
public static void main(String [] args){
person p1=new person("大致",11,"中国");
p1.show();
person p2=new person("小明",11);
p2.show();
person p3=new person("小刚",11);
p3.show();
}
}
0 0
- Static成员和方法
- static方法成员
- 成员方法 参数 调用 static final
- static 成员和方法使用常见错误
- java中static修饰成员方法
- static成员与const方法(十五)
- java的static关键字——static成员方法
- 类继承中子类static成员方法与父类static成员方法调用顺序浅析
- static成员
- static成员
- static成员
- static成员
- static代码块、成员变量初始化、构造方法执行顺序
- 在run方法中使用static成员变量问题
- 成员内部类不能含有static的变量和方法
- static方法中,不能访问类内非static成员变量和方法。
- static成员和static成员函数
- static数据成员与static成员函数
- MySQL数据库优化(六)——MySQL分表和表分区
- 弹性计算
- 关于Goroutine的原理
- Spring Mvc那点事---(16)Spring Mvc之JSTL标签
- ssh 无密码登陆基本原理
- static方法成员
- 手动打包MVC项目成Web Deploy包,发布至服务器
- Python if和for条件语句
- Codevs 3100 蜗牛的旅行
- 数字图像处理,一种简单的颜色平衡算法
- 12、Spring框架核心
- 原子操作的一段代码学到的知识
- Android开源框架真的是捷径……开发吗
- iOS JSON Model 转换 MJExtension