Tag:Static state

  • Instance methods and static methods call each other.


    1. Can instance methods be called directly in static methods? 2. Can static methods be called directly in instance methods? In fact, we only need to understand a reason. In the case of Java, we must have the main body. The method is not a first-class citizen. It can not be directly used as a […]

  • Usage of PHP anonymous classes


    After PHP 7, the feature of anonymous classes has been added to PHP. Anonymous classes and anonymous methods make PHP a more modern language and make our code development more and more convenient. Let’s first look at the simple use of anonymous classes. //Direct definition $objA = new class { public function getName() { echo […]

  • How to use static methods and static variables in the project


    Use static methods to complete some tool classes: public class Computer {   public static int plus(int i,int j){ return i + j; }   public static int minus(int i,int j){ return i – j; } } How to use it?   Computer.plus(3,2);   Use static variables to complete the definition of some global constant classes with only […]

  • Parsing the second hem of the queuemail interface of Hongmeng kernel message queue


    Summary:This paper leads you to analyze the source code of the two interfaces of queuemail of the queue module of Hongmeng light kernel. This article is shared from Huawei cloud community《Hongmeng light kernel m core source code analysis series 13 (Continued) message queue queuemail interface》, author: zhushy. The queue has been analyzed before (queue) to […]

  • Java implementation and thinking of singleton mode


    1、 Abstract This paper analyzes the different implementation methods of singleton mode in Java, compares the advantages and disadvantages of different schemes, and gives the use conclusion. 2、 Implementation of singleton mode The essence of singleton pattern is to control that a class has only one unique instance and provide a unified access point. It […]

  • Why is block modified with copy


    Introduction to block: blockIn fact, it is a code block. Encapsulate the code you want to execute in this code block and call it when necessary. Is that block an OC object? The answer is yes Modifier Simply put, block is like a function pointer to the function we want to use. Just like the […]

  • 11.5K Star! An open source Python static type checking Library


    [introduction]: Python static type check library can find potential errors in the program. brief introduction Mypy is Python’s static type checking library. You can add type annotations to Python programs and use mypy to check their static types. You can find potential errors in the program without running code. It can also be added to […]

  • Use of late static binding in PHP


    What is post static binding? In fact, in our previous articleStatic in PHPI’ve already said this in. Today, we’d better understand this concept again. First, we introduce the concept of late static binding through a piece of code: class A { public static function who() { echo __CLASS__, PHP_EOL; } public static function test() { […]

  • My advanced IOS interview in 2021


    I have participated in many interviews this year. Let’s see what my interview questions are The interview questions I can remember What’s up, runloop? Briefly describe the execution sequence of runloop and realize a background resident thread with runloop.reference resourceshttps://juejin.cn/post/6868551023439544333 List several methods to implement deferred call? Briefly describe the difference between process oriented and […]

  • Solve QT program abnormal suspension and error report__ acrt_ first_ block == header


    Using vs to develop QT program under windows, if the function tostdstring is used to convert qstring to STD:: string, it may crash and report an error__ acrt_ first_ block == header。 This crash occurs when the vs project’s runtime is set to static link (/ MT). If the runtime is set to dynamic link […]

  • Support for static files in Django


    Original address:[http://agiliq.com/blog/2013/03/serving-static-files-in-django/] Dealing with static files, especially in development, is a painful thing. In this article, we will discuss some settings, directory structure and their interaction. Set upDEBUG = TrueThen let’s start developing. We will create a Django project so that we can better understand what directory these files are in. We will use django1 […]

  • Talk about what I know about Android related code detection


    Talk about what I know about Android related code detection Because my business development ability is not enough, I often do some peripheral chores. I have done the work of establishing code detection mechanism in the team, so I want to briefly talk about this part. Status of code detection The first thing to say […]