zoukankan      html  css  js  c++  java
  • 字面量理解

    字面量是你临时给定的 一个没有任何引用的值(包括基本数据类型和字符串)

    常量是一个带引用的不可更改的值 你可以在程序的任何地方(当然只要是可访问到的地方)引用它

    字面量不行 在你出现字面量的改行语句结束以后 这个字面量就无法被再次使用了

    In programming, a value written exactly as it’s meant to be interpreted. In contrast, a variable is a name that can represent different values during the execution of the program. And a constant is a name that represents the same value throughout a program. But a literal is not a name — it is the value itself.
    A literal can be a number, a character, or a string. For example, in the expression,
    x = 3
    x is a variable, and 3 is a literal.
    —————————————————————————————————————————————————————
    维基百科的解释是:In computer science, a literal is a notation for representing a fixed value in source code.
    字面量就是用来描述源代码中固定值的表示法。
    x = 3; //x是变量,3这个值就是字面量。

  • 相关阅读:
    由优化反射性能问题引发的思考
    Flash还能走多远?
    .net CLR 4.0垃圾回收机制的改进之3
    Silverlight 3引入了GPU加速的特性
    java 字符串
    JAVA 容器
    JAVA 反转链表
    JAVA 自定义比较器
    JAVA 类相关知识
    vscode 输出中文乱码
  • 原文地址:https://www.cnblogs.com/549294286/p/3516510.html
Copyright © 2011-2022 走看看