其他分享
首页 > 其他分享> > DAY3 标识符

DAY3 标识符

作者:互联网

DAY3 标识符

class、static、void、public

above遇到过的。

数据类型

int byte(一字节大小补码)

short\long

float\double\

char\String(不是关键字、是类)

boolean(true false)

引用类型

类、接口。。。。

变量

局部变量、 必须初始化和定义

实例变量、

public class Demo{
    String name;
    int age;
    public static void main(String[] args){
        Demo demo1 =new Demo();
        demo1.name = "张三";
        System.out.println(demo1.name);
        System.out.println(demo1.age);
    }
}

类变量、static

static int age = 24;

常量

final 
static final age = 111;
final static age = 111;
//修饰符不区分前后

常量名一般用大写 MAX_VALUE

类名 首字母大写驼峰写法

其他首字母小写驼峰写法

标签:String,int,age,DAY3,demo1,static,标识符,final
来源: https://blog.csdn.net/weixin_45627946/article/details/122416977