`

[#0x0007] final

    博客分类:
  • Java
 
阅读更多

1. final data (基本数据类型)

  相当于const

 

2. final reference

  意味着该引用被绑定到一个具体对象,即该引用不能再指向另外一个对象。

  但这个被指向的对象本身是可以发生变化的。

 

P.S. final data和final reference必须在定义处或是构造器中初始化(注意:这里说的“必须在定义处或是构造器中初始化”指的是类的final member,即final成员。如果在方法中定义final data或final reference,则没有这个限制)。所谓blank final (我谓之dynamic final),即是先声明final data或是final reference,不在定义处初始化而是根据具体情况灵活地在构造器中初始化。

 

P.S. 参考0x003F ,final data 和 final reference 可以理解为:final 保证栈上的值不可修改

 

3. final function

  final function可以继承,可以重载,不可覆写。

 

4. final class

  final class不可继承

分享到:
评论

相关推荐

    C++ 0x Standard - Final Committee Draft

    ISO 2010 — All rights reserved ISO/IEC JTC1 SC22 WG21 N3092 Date: 2010-03-26 ISO/IEC IS 14882 ISO/IEC JTC1 SC22 Secretariat: ANSI ...Document stage: (30) Final Committee Draft Document Language: E

    STM32 + VL53L0激光测距 TOF 软件I2C协议代码

    VL53L0x 是ST公司生成的 TOF激光测距传感器,得益于非常小巧的尺寸,很容易放入手机、无人机中,提供更加精准、稳定的测距方式。 ...#define VL53L0X_REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD 0x70 #

    android开发程序

    public static final int blue=0x7f040001; public static final int btb=0x7f040009; public static final int green=0x7f040006; public static final int hese=0x7f040008; public static final int light...

    88个Android应用程序.zip

    public static final int ic_launcher=0x7f020000; } public static final class id { public static final int editText=0x7f050002; public static final int getBtn=0x7f050000; public static final int ...

    ANDROID 黑白棋

    public static final int black=0x7f020000; public static final int empty=0x7f020001; public static final int icon=0x7f020002; public static final int white=0x7f020003; } public static final class...

    dotnetframework4.7.2证书

    解决Windows7安装dotnetframework4.7.2证书问题:Installation failed with error code: (0x800B0109), "已处理证书,但无法建立到信任根颁发机构的证书链

    阳历转阴历_java

    final static long[] lunarInfo = new long[] { 0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0...

    数据恢复软件 FinalData3.0.

    数据恢复

    ANDROID 水泡泡

    public static final int icon=0x7f020000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f...

    poi-3.5-FINAL-my.jar

    Initialisation of record 0x1D left 1 bytes remaining still to be read.这个问题可以用这个包试一下

    Java-关键字final详解(public static final)

    一、final修饰类 B类继承A类,相当于对A类的功能进行扩展,如果不希望对A类进行扩展,可以给A类加final关键字,这样的话,A类就无法继承了。...解析:s2里面最初分配了0x123,然而你再给final进行赋值就不行了,因

    WinNTSetup_v3.9.0_Final_Plus

    WinNTSetup_v3.9.0_Final_Plus,用于安装winows xp,Windows 7,windows 10等

    MD5Code加密技术

    static final int S11 = 7; static final int S12 = 12; static final int S13 = 17; static final int S14 = 22; static final int S21 = 5; static final int S22 = 9; static final int S23 = 14; ...

    贝塞尔曲线

    private static final int STATE_READY = 0x0001; private static final int STATE_RUNNING = 0x0002; private static final int STATE_STOP = 0x0004; private static final int STATE_TOUCH = 0x0010; ...

    ap6212a0_a33_sc3817r_神舟验证版本_借用nvram_ap6210这个配置文件_20170626_1834没有外层目录.7z

    调通sina33下的AP6212A0(WIFI+BT) 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 ...完成时间:2017/6/26 11:01 版本:V1.1 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android...

    BluetoothDemoV1.2

    private static final int REQUEST_ENABLE = 0x1; private static final int REQUEST_EX = 1; /* 请求能够被搜索 */ private static final int REQUEST_DISCOVERABLE = 0x2; private List<BluetoothDevice> _...

    ap6212a0_a33_sc3817r_服务器验证通过_bt已经通了_wifi需要修改配置_需要再次验证_20170626_1549.7z

    调通sina33下的AP6212A0版本的BT 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 ...完成时间:2017/6/26 11:01 版本:V1.0 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android...

    BluetoothDemo

    private static final int REQUEST_ENABLE = 0x1; private static final int REQUEST_EX = 1; /* 请求能够被搜索 */ private static final int REQUEST_DISCOVERABLE = 0x2; private List<BluetoothDevice> _...

    JAVA算法大全

    int CRCTABLE[] = { 0xF078, 0xE1F1, 0xD36A, 0xC2E3, 0xB65C, 0xA7D5, 0x954E, 0x84C7, 0x7C30, 0x6DB9, 0x5F22, 0x4EAB, 0x3A14, 0x2B9D, 0x1906, 0x088F, 0xE0F9, 0xF170, 0xC3EB, 0xD262, 0xA6DD, 0xB754, 0x85...

    MD5加密类详细写法

    这里把它们实现成为static final是表示了只读,切能在同一个进程空间内的多个 Instance间共享*/ static final int S11 = 7; static final int S12 = 12; static final int S13 = 17; static final int S14 = ...

Global site tag (gtag.js) - Google Analytics