Tags: Integer cache, == , equals This Blogger emphasizes that in actual development, developers should prioritize using .equals() to compare object values rather than simply relying on == to compare references. Java's Integer cache mechanism provides memory optimization for Java programs with values in the range of -128 to 127.However, values outside this range will result in the creation of new objects, resulting in unexpected results in == comparisons. public static void main(String[] args) { Integer a = 228; Integer b = 228; System.out.println(a == b); // false Integer x = 1; Integer y = 1; System.out.println(x == y); // true Integer c = 228; Integer d = 228; System.out.println(System.identityHash...
Control Panel > System and Security > System > Time & language > Language & region>Preferred languages > 中文的右边3个点... 点击打开 > Language options > Options->Keyboards > Microsoft Pinyin (... -》 ... keyboard options) > General > choose a character set: Simplifed Chinese;(Traditional Chinese)
process | Node.js http://nodejs.cn/api/process.html process is a global object http://nodejs.cn/api/process.html#process_process_env demo in script: if (process.env.NODE_ENV === 'production') { module.exports = require('./prod.js') } else { module.exports = require('./dev.js') } input "node" line commend node > process.env // show value On Windows: set test=testValue on OS X or Linux: export test=testValue In js file process.env.test= 'dev'; package.json: "scripts": { "start": "set test=dev && node app.js" } ------------------------ Windows environment variant cmd > set test-env // exit set test-env=production set path=%path%;C:\web;C:\Tools set test-env= my computer -> property -> advance -> environment variant... ---------------------- Linux echo $test-env //check value of test-env // set value of test-env export test-env=production # attach va...
评论
发表评论