码迷,mamicode.com
首页 > 其他好文 > 详细

优化变量操作步骤 ----多个变量类型相同时的情况

时间:2019-01-01 19:19:31      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:class   font   div   优化   stat   static   相同   []   操作   

 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 }

 

优化变量操作步骤 ----多个变量类型相同时的情况

标签:class   font   div   优化   stat   static   相同   []   操作   

原文地址:https://www.cnblogs.com/penphy/p/10205510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!