【NB】字面值

编程开发   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2023-2-23

字面值类型

byte b=127;
short s=30000;
int i=2140000000;
long l=900000000;
float f=3.14F;
double d=3.141592678987;
char c='l';
String str="love";

package com.weiliang;

public class VariableType {
public static void main(String[] args) {
double num = 3.14;
double num1 = 2.769343;
int num2 = 365;
int num3 = 12;
char eat = '吃';
boolean falses = false;
String font = "不可描述";
String tab = "\t hahah";
byte b =100;
short s =20;
int i = 999999999;
long l = 999999999L;
float f = 13.14f;
double d =32421.2134;
char c = '中';
String str = "我爱我的国";
System.out.println(tab);


public class bianliang {
public static void main(String[] arges) {
byte b; b = 112;
short s; s = 16777;
int i ;i = 1236789674;
float f;f = 1278890899;
long l ; l=12312312L;
double d ;d = 123.46786786786786786787667867866786;
char c ;c= '文';
String str;str = "不可预测";
System.out.println(b+" "+s+" "+i+" "+f+" "+d+" "+c+" "+str );
}

}

沙发
NB狐狸 2023-2-27
黑夜给了我黑色眼睛,我却用它寻找光明

评论

登录后才可发表内容
  • 主题

    140

  • 帖子

    219

  • 关注者

    0

TA的新帖
Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:0.1054s Mem:2065Kb