1, Put a piece of code into a separate function
1.1 code example
1.2 application scenarios
When there is an overly long function or a piece of code that needs comments to make people understand its purpose, put this code into a separate function.
First, there is a greater chance that functions can be reused with each ...
Posted by TheIceman5 on Wed, 10 Aug 2022 21:29:37 +0300
There are four roles as follows. The attributes and behaviors of these roles are
Stock investors: name, age, study stock speculation, speak English
Fund Investor: name, age, study and speculation
Stock Manager: name, age, teaching stock trading, speaking English
Fund manager: name, age, teaching and speculation base
Posted by ballhogjoni on Tue, 09 Aug 2022 21:47:12 +0300
Characteristics of encapsulation: data can only be accessed through specified methods.Hide the instance details of the class to facilitate modification and implementation.Specific practical steps of packaging
Modify the visibility of attributes to restrict access to attributes, which is generally set to private.Create a pa ...
1, Ask questions with Lombok
1. Open settings (shortcut key: ctrl+alt+s) in idea, search plugin, search lombok in plugins, and install
2. Introduce lombok dependencies into the project
Posted by jf3000 on Tue, 09 Aug 2022 11:59:23 +0300
1, What is exception handling Exception handling is also called exception handling. There are two purposes to deal with exceptions in the program, one is to find the exceptions in the program, and the other is to operate the exceptions relatively or notify the programmer to modify them. Using the try catch statement can accomplish these two pur ...
Posted by bothwell on Sat, 06 Aug 2022 21:26:11 +0300
1, What is Seletor?
The literal meaning of selector is not easy to understand. Seletor is a listener that can listen to events in the Channel. Channels can be registered in the seletor. When these registered channels have events, the seletor's select method will return these events to the thread for processing.
2, The difference bet ...
1, lateinit delay initialization keyword
Many syntax features in Kotlin, such as variable immutability, variable non nullability, and so on, are designed to ensure program safety as much as possible. For example, there are many global variable instances in your class. In order to ensure that they can meet Kotlin's null pointer check sta ...
What is object-oriented?
The process oriented method of solving problems is to follow the steps we have analyzed, step by step, follow the principle of top-down and gradual refinement, and focus on the process and steps of solving problems.
Java Language is an object-oriented programming language, and obj ...
Posted by the_ut_tick on Sat, 30 Jul 2022 22:17:10 +0300
In the program engineering training course, a problem occurred:
Mobile phone screenshot nucleic acid detection report, using OpenCV software to automatically identify whether the time for nucleic acid detection is within 72 hours.
Software needed to accomplish this task:
- OpenCV-Py ...
Posted by fitzromeo on Sat, 02 Jul 2022 22:04:45 +0300
Write, append, read and copy operations of golang files
There is an OpenFile function under the os package of the Go language. Its prototype is as follows:
func OpenFile(name string, flag int, perm FileMode) (file *File, err error)
Where name is the file name of the file. If you are not running under the current path, you need to add the spe ...
Posted by teddmcload on Thu, 30 Jun 2022 16:56:27 +0300