Tag:local variable

  • Variable of Java Foundation

    Time:2021-5-13

    Overview of variables A variable is actually a small area in memory, which can be accessed by using the variable name. Therefore, each variable must be applied (declared) and then assigned (filled in) before it can be used. Definition of variable: 1. Statement 2. Assignment 3. Use be careful: 1. Variables must be declared first, […]

  • JS learning notes 01 variable

    Time:2021-5-12

    VaR, let keywords 1. The variable declared by VAR will become the local variable of the function containing it, which will be destroyed when the function exits. If you omit the VaR keyword, a global variable is created (not recommended). function test() { var message1 = “hi”; // local variable message2 = “hi”; // global […]

  • JavaScript variable promotion

    Time:2021-5-7

    Variable promotion: When JS code runs again, scan all variables and functions to promote them at the top of the scope. VaR, which is not inside the function, defines global variables and is promoted to the top of the scope;Function, the whole function body is promoted to the top of the scope;If the function isDefining […]

  • JavaScript — function

    Time:2021-5-4

    1、 Function definition and call (same as Python) //Nonparametric function function f1() { console.log(“Hello world!”); }; f1(); //Parametric function function f2(a, b) { console.log(arguments); // Built in arguments object console.log(arguments.length); console.log(arguments[0],arguments[1]); console.log(a, b); }; f2(10,20); //Function with return value function sum(a, b){ return a + b; } sum(1, 2); // Call function //Anonymous function var […]

  • Javascript: object oriented closure

    Time:2021-4-25

    Understanding closure concept A closure is a function that has access to a variable in the scope of another function. Functional closure (saves data internally and has no side effects externally) Creation method Create another function (closure) inside a function principle Common function: after outer() is executed, the local variable local is destroyed, and the […]

  • Do you know what string did to “+”

    Time:2021-3-19

    Here’s a simple piece of code public class StringPlusTest{ public static void main(String[] args) { String s1 = “aaa”; String s2 = “bbb”; String s = “ccc” +s1 + s2 +”ddd”; } } usejavap -c .\StringPlusTest.classDecompile and get Compiled from “StringPlusTest.java” public class com.epoint.codetuning.test.StringPlusTest { public com.epoint.codetuning.test.StringPlusTest(); Code: 0: aload_0 1: invokespecial #1 // Method […]

  • TLS and asynclocal in. Net

    Time:2021-3-19

    1、 TLS Thread local storage literally means the storage space of a thread. Variables are generally divided into global variables and local variables. All threads in a process share the address space, which is divided into several inherent areas, such as stack area and global variable area. Global variables are stored in the global variable […]

  • Notes on Linux basic learning (3) using Linux environment variables

    Time:2021-3-11

    Linux (learning notes based on the complete book of Linux command line and shell script programming) 6 using Linux environment variables Definition of environment variable Bash shell uses a feature called environment variable to store information about shell session and working environment global variable local variable Global environment variables Global environment variables are visible to […]

  • JVM instruction manual

    Time:2021-3-10

    Stack and local variable operation The instruction to push a constant onto the stack aconst_ Null willnullObject reference is pushed onto the stack-1Push into stack0Push into stack1Push into stack2Push into stack3Push into stack4Push into stack5Push into stack0Push into stack1Push into stack0Push into stack1Push into stack0Push into stack1Push into stack8Bit signed integers are pushed onto the […]

  • PHP code optimization

    Time:2021-2-3

    Performance advantages and disadvantages of using PHP built-in functions Use as few magic functions as possible The suppressor @ has extra overhead Optimization point: reasonable use of memory, use unset() to release unused memory in time (unset() can not log off) Avoid doing operations in loops Reduce computing intensive business Be sure to use quoted […]

  • 5 constant and variable

    Time:2021-1-8

    5.1 identifier It is composed of letters, numbers and underscores, but cannot start with numbers; The case of English letters represents different identifiers; Identifier cannot be a keyword. Other rules: Constants are named in uppercase. #define AGE 20 All member variables are expressed in M_ Here we go. int m_ Age Common variable, take the […]

  • Nonlocal keyword

    Time:2020-12-31

    1. What is the role of nonlocal? What are the features of Python? In the outer function, you can use the keyword of the inner function directly. In Python, the definition of a function can be nested, that is, the body of a function can contain the definition of another function. 2、Demo Cases without non […]