1 class Var04{
2 public static void main(String[] args) {
3 //将0.1 111.5 -1 51.6值存放在变量中,并输出变量的值
4 /*double a;
5 double b;
6 int c;
7 double d;*/
8 //double a,b,d;
9 //优化,如果有多个变量类型相同时,则可以一次声明多个变量,之间使用英文逗号隔开
10 double a =0.1, b=111.5, d=51.6;
11 int c = -1;
12 System.out.println("a =" + a + "\nb =" + b + "\nd = " + d + "\nc =" + c) ;
13
14 }
15 }
优化变量操作步骤 ----多个变量类型相同时的情况
猜你喜欢
转载自www.cnblogs.com/penphy/p/10205510.html
今日推荐
周排行