zoukankan      html  css  js  c++  java
  • java数据类型

    java中有几种特殊的类型String, Array,Enum, 属于Object,派生出来的, 但是String可以做加法, 另外两个可以花括号定义初值;

    primitive type(基本值类型) VS Object type(对象类型)

    装包和拆包

    /**
         * Returns an {@code Integer} instance representing the specified
         * {@code int} value.  If a new {@code Integer} instance is not
         * required, this method should generally be used in preference to
         * the constructor {@link #Integer(int)}, as this method is likely
         * to yield significantly better space and time performance by
         * caching frequently requested values.
         *
         * This method will always cache values in the range -128 to 127,
         * inclusive, and may cache other values outside of this range.
         *
         * @param  i an {@code int} value.
         * @return an {@code Integer} instance representing {@code i}.
         * @since  1.5
         */
        public static Integer valueOf(int i) {
            if (i >= IntegerCache.low && i <= IntegerCache.high)
                return IntegerCache.cache[i + (-IntegerCache.low)];
            return new Integer(i);
        }

    .valueOf ()  两个进行比较可能等也可能不等。

    另外在进行

    数值初始化的时候数组可以直接输出值, 比如int[] 可以对某一个值输出0,

    而int a;  直接使用会编译错误;

  • 相关阅读:
    asp.net发送邮件
    jquery+TreeView 级联 复选框 checkbox 级联
    100层楼,两个会坏的杯子,测从哪层开始坏【算法思想】
    flex中dragdrop不响应的原因
    flex 中urlrequest缓存问题
    程序员技术练级攻略
    consistent hashing
    入门教材
    烙饼啊烙饼{转自ITEO
    杂乱的工作记录
  • 原文地址:https://www.cnblogs.com/wangnuo/p/7728804.html
Copyright © 2011-2022 走看看