编写一个的JAVA程序,定义a,b,d…h8个变量并赋值,

2020-09-22 教育 133阅读
public class Demo3 {
public static void main(String[] args) {
byte a =1;
short b=1;
int c = 1;
long d = 1l;
float e=1f;
double f =1;
char g ='1';
boolean h = true;
System.out.println("byte a ="+a);
System.out.println("short b="+b);
System.out.println("int c ="+c);
System.out.println("long d ="+d);
System.out.println("float e="+e);
System.out.println("double f ="+f);
System.out.println("char g ="+g);
System.out.println("boolean h ="+h);
int x=a%b;
long y = c+d;
boolean z=(b==c);
System.out.println("int x="+x);
System.out.println("long y"+y);
System.out.println("boolean z"+z);
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com