1.final的变量的值不能被改变
final的成员变量
final的局部变量(形参)
2.final的方法不能被重写
3.final的类不能被继承
墨衍会员
·
AI 创作全网分发
墨衍智能分发
本文由作者通过墨衍一键同步至各平台
1分发平台
400+累计阅读
439平均单平台
已同步平台
优快云
微信公众号
微博
知乎
掘金
百家号
博客园
抖音
小红书
你的文章也可以这样分发
墨衍会员 ¥399起/年,写一次发全网
我也要 →
码龄12年
1.final的变量的值不能被改变
final的成员变量
final的局部变量(形参)
2.final的方法不能被重写
3.final的类不能被继承
SAP物料分类账(ML)避坑指南:激活顺序错了怎么办?从CKMSTART到差异分摊的完整流程
本文详细解析SAP物料分类账(ML)的正确激活顺序与配置流程,帮助用户避免常见陷阱如'LKW无科目'、'在制品重估失败'等问题。从CKMSTART到差异分摊的完整流程,涵盖关键配置节点、典型报错分析与应急处理方案,确保产品成本控制(CO-PC)模块的顺利运行。
java中final关键字
final final是java语言中的一个关键字 final表示最终的,不可变的。 final可以修饰变量以及方法,还有类等。 final修饰的类(无法被继承) final class A{ //A 是没有子孙的 } class B extends A{ //错误的, 无法从最终类A进行继承 //B类继承A类 相当于对A类功能进行扩展 //如果不希望别人对A类进行扩展,可以给A类加final关键字,如String类 } final修饰的方法(无法被覆盖,重
【Java完整版 面试必备】Leetcode Top100题目和答案-滑动窗口篇
【Java完整版 面试必备】Leetcode Top100题目和答案-滑动窗口篇
java final 关键字
java的final关键字详解
反相器(inverter)和缓冲器(buffer)---附加与非门原理图
下面是对反相器(Inverter)和缓冲器(Buffer)从面积、驱动能力、时序等多个角度的详细对比,列出的是一般情况下的比较,具体情况可能会受到工艺节点、设计库和特定设计要求的影响。缓冲器(Buffer)是数字电路中常见的逻辑门之一,用于增强信号的驱动能力,而不改变信号的逻辑状态。如下图所示的CMOS反相器,由一个NMOS和PMOS组成,栅端gate相连作为输入端Vin,漏端相连作为输出端Vout,NMOS的源端接地,PMOS的源端接电源VDD.与反相器不同,缓冲器的输出与输入保持相同的逻辑状态。
华为AR6140E/S5735设备密码策略配置全攻略:从复杂度到锁定机制
本文详细介绍了华为AR6140E/S5735设备的密码策略配置方法,涵盖密码复杂度、时效性和防护性三大核心维度。通过具体的CLI命令示例,指导管理员如何设置密码长度、字符组合、有效期及登录失败锁定等安全机制,为企业网络提供全面的用户名密码防护策略。
Java final关键字
总之,Java 中的final关键字是一个功能强大的工具,具有优点和缺点。它在不可变性、定义算法结构、提供代码清晰度、确保安全性和稳定性、线程安全、以及保护遗留代码等方面起着重要作用。尽管存在一些缺点,如测试和调试的帮助较少、动态性较低、灵活性有限,这些问题可能会使程序的执行更加复杂。然而,如果我们更多地关注其积极的一面而非缺点,我们可以看到final关键字在限制继承、保持值的恒定性以及防止更改和修改方面的重要性。
Cesium中级开发教程之二十二:视锥体
教程示例网站:https://thomaz529.github.io。
Java中的final关键字
在java中可以将实例域定义为final。在构建对象是必须初始化这样的值。必须确保在每个构造器执行之后,这个域的值被设置,并且在后面的操作中不再对其修改。使用final声明变量之后,这个值就不能修改,一般final类型的变量都被声明为静态变量,而且是公有类型的,它在内存中被放在一个特有的公共区域。 也就是说,在Java语法中规定,final修饰的成员变量必须有程序员显式地指定初始值。 定义格式...
基于STM32L4XX、HAL库的MAX13487EESA RS485总线收发器驱动程序设计
MAX13487EESA是一款3.3V供电的RS-485/RS-422收发器,由Maxim Integrated生产。PA4 (控制引脚) ---> /RE, DE (连接在一起)具有±15kV ESD保护的驱动器输出和接收器输入。半双工RS-485/RS-422通信。工业温度范围:-40°C至+85°C。工作电压范围:3.0V至3.6V。数据速率高达250kbps。
RML2018.01a数据集的读取与使用
基于深度学习的自动调制识别
Java-final关键字详解
final使用final关键字定义常量,使得这些值在程序运行期间保持不变。
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
有关Java中关键字final的理解
一、final数据在java编程语言中,有时候需要告知编译器一段数据是不变的编译期常量。对于这种情况,编译器可以将此常量值带入需要用到它的计算式子当中,这种在编译时执行计算式的方法减轻了运行时的开销。通常,这类常量数据都是基本类型的数据,并赋予关键字final,同时在对此常量定义时需要进行赋值。值得注意的是:对于基本类型,使用final关键字将使数值恒定不变;而对于对象引用,final则是
SAP B1中文培訓教材_SDK
公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说
温度PID控制PLC程序
温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值
java关键字之final
java关键字之final 学习Java的同学注意了!!! 学习过程中遇到什么问题或者想获取学习资源的话,欢迎加入Java学习交流群,群号码:543120397 我们一起学Java!
NTscan扫描工具
ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。
Java基础之final关键字详解
final在Java中可以声明成员变量、方法、类以及本地变量。一旦你将引用声明作final,你将不能改变这个引用了,如果你试图将变量再次初始化的话,编译器会报编译错误。 final的含义在不同的场景下有细微的差别,但总体来说,它指的
Java 中 final 关键字详解
在 Java 中,final 关键字可以修饰的东西比较多,很容易混淆,在这里记录一下。主要从功能上说明一下,不做过多的代码演示。 final 关键字用途 1. final 变量 凡是对成员变量或者本地变量(在方法中的或者代码块中的变量称为本地变量)声明为final的都叫作final变量。final变量经常和static关键字一起使用,作为常量。用final关键字修饰的变量,只能进行一次赋值操作,并且在生存期内不可以改变它的值。 2. final方法参数 如果 final 关键字修饰方法参数时,方法中是不能改
Java Final关键字示例
Java中的Final关键字是一个修饰符,用于限制用户执行不需要的代码或防止代码或值被更改。 可以在3个上下文中使用此关键字。 他们是: 最终关键字作为变量修饰符 最终关键字作为方法修饰符 Final关键字作为类修饰符 每个上下文都有其自身的意义和暗示的限制。 它们将在下面详细讨论。 1. FINAL关键字作为变量修饰符 每个上下文都有其自己的不同目的。 final ...
java中final double_举例讲解Java中final关键字的用法
1. final variablefinal variable 就是一个常量,一旦被初始化就不可以被改变。class Test1 {final double PI = 3.14; //常量的名称最好大写public Test1(){PI = 3.14;}void test(){System.out.println("PI is: " + PI);}public static void main(S...
java中final关键字的总结
final关键字的理解 可以用于生命属性,方法,方法参数和类。分别表示属性不可变(这里不可变指引用的不可变,而非对象的不可变 ),方法不可被覆盖或重写,方法参数和属性相同,类不可被继承(此时类内所有方法默认成为final类型)。 -final声明属性 被final修饰的变量不可变指的是引用的不可变性,而不是对象的不可变,它只能指向初始时指向的那个对象,但是指向对象的内容是可以变化的。所以...
java final关键字
java final关键字final关键字的含义是什么?final关键字的用法有哪些?final关键字具体怎么用? final关键字的含义是什么? final关键字通常指“这是无法改变的”。主要用于设计或者优化。但是随着java的发展,优化的功能基本无效了。 final关键字的用法有哪些? final数据:数据具有只读性。 final方法:方法不可被覆盖。(private方法隐含final效果)...
java中static关键字和final关键字
原文地址:http://www.cnblogs.com/dolphin0520/p/3736238.html 谈到final关键字,想必很多人都不陌生,在使用匿名内部类的时候可能会经常用到final关键字。另外,Java中的String类就是一个final类,那么今天我们就来了解final这个关键字的用法。下面是本文的目录大纲: 一.final关键字的基本用法 二.深入理解f
详解Java中的final关键字
文章目录final 简介[^1]final 修饰变量final 修饰类final 修饰方法final 优化编码的艺术 final 简介1 final关键字可用于多个场景,且在不同场景具有不同的作用。首先,final是一个非访问修饰符,仅适用于变量,方法或类。下面是使用final的不同场景: 上面这张图可以概括成: 当final修饰变量时,被修饰的变量必须被初始化(赋值),且后续不能修改其值,实...
Java中的final关键字详解
三种被final修饰的场景:Java中final关键字的使用很频繁,它可以修饰变量、方法跟类。“final”的英文意思是最终的、不可更改的意思,因此被final修饰的变量、方法或类是不能被更改的。 final一般会跟static关键字结合使用。
3万+
1万+

被折叠的 条评论
为什么被折叠?



