JAVA基本数据类型的初始值-创新互联

基本数据类型初始值
定义变量不赋值在类中方法外不会有错误,但是定义在方法内不引用时不会编译出错,如果被引用就会编译出错

创新互联公司从2013年创立,是专业互联网技术服务公司,拥有项目做网站、网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元会同做网站,已为上家服务,为会同各地企业和个人服务,联系电话:028-86922220
package com.qf.test;
import org.testng.annotations.Test;
public class Demo {int a; char b; byte c; short j; long d; 
    float e;  double f; boolean g;
    @Test
    public void test() {System.out.println("byte:" + c);
        System.out.println("short :" + j);
        System.out.println("int :" + a);
        System.out.println("char:" + b);
        System.out.println("long:" + d);
        System.out.println("float:" + e);
        System.out.println("double:" + f);
        System.out.println("boolean:" + g);
    }
}

结果
在这里插入图片描述

你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧


当前题目:JAVA基本数据类型的初始值-创新互联
文章源于:http://scyanting.com/article/hcjdo.html