zoukankan      html  css  js  c++  java
  • 优化变量的操作步骤

     1 class Var02 {
     2     public static void main(String[] args) {
     3         //变量的操作步骤:
     4         //第一步:声明变量
     5         int a;
     6         double b;
     7         String c;
     8         //第二步:赋值
     9         a = 100;
    10         b = 3.14;
    11         c =  "北京市";
    12         //第三 步:使用
    13         //System.out.println("a");        注意: 双引号中的内容是原样输出的
    14         System.out.println(a);//100
    15         System.out.println(b);//3.14
    16         System.out.println(c);//"北京市"
    17     
    18     }
    19 }

    20 class Var03 { 21 public static void main(String[] args) { 22 //优化Var02类中的代码 23 //在声明的同时完成赋值,也就是说第一步和第二步合二为一 24 //语法格式: 数据类型 变量名称 = 值 25 int a = 100; 26 double b = 3.14; 27 String c = "北京市"; 28 29 //使用 30 System.out.println("a = " + a); // + 表示连接 31 System.out.println("b = " + b); 32 System.out.println("c = " + c); 33 34 35 36 } 37 }
    坎坷困难会让你不断的强大起来 -- 前提是你别怂
  • 相关阅读:
    5-把自己的系统刷到开发板
    4-构建网络文件系统
    ipc
    advio
    pthread
    signal
    process_control
    python3.6+selenium_Testsuits测试套件
    python3.6+selenium_多个测试用例
    jQuery的九类选择器
  • 原文地址:https://www.cnblogs.com/penphy/p/10205255.html
Copyright © 2011-2022 走看看