Learn Java from scratch--day05--Arrays
array
1. Array concept
Array: A fixed container for storing multiple elements of the same data type in a program.
Prerequisites for arrays (characteristics): 1. Once the array is initialized, its length is fixed; 2. The elements in an array must be of the same data type in memory; 3. The number of elements in the array must be multiple; ...
Added by dirkbonenkamp on Mon, 21 Feb 2022 19:41:24 +0200
Day25 communication between Java threads (unfinished)
Multithreading (Continued)
Lock lock
Although the synchronization code block and synchronization method solve the thread safety problem, they can't express where the Lock is added and where the Lock is released, so in jdk1 After 5, a new Lock object is provided: Lock
Lock is an interface with two methods:
void lock(): lock; void lock(): rel ...
Added by Dutch MaFia-boy on Mon, 21 Feb 2022 15:59:47 +0200
C language: function 1.0
1. What is the function?
Wikipedia definition of function: subroutine
Subroutine is a part of code in a large program, which is composed of one or more statement blocks. It is responsible for completing a specific task and has relative independence compared with other codes.
Generally, there are input parameters and return values, which prov ...
Added by jimmy2gurpreet on Mon, 21 Feb 2022 14:06:17 +0200
ATP application test platform -- Filter, Interceptor, Resolver and Aop in java application, can you understand it?
preface
Filter, Interceptor, Resolver and Aop are technologies often used in our application development. In this section, we will introduce their usage and application scenarios.
text
filter
Filter is a means of preprocessing web resources that depends on the existence of servlet. It does not depend on the start of spring container. It ...
Added by CoolAsCarlito on Mon, 21 Feb 2022 13:15:08 +0200
Secrets you don't know about synchronized
Synchronized principle
Chapter one: three problems of concurrent programming
visibility
concept
Visibility: when one thread modifies a shared variable, other threads get the latest information immediately after the modification
demonstration
//1. Static member variable
private static boolean var = true;
public static void main(String[] ...
Added by Steveo31 on Mon, 21 Feb 2022 13:11:43 +0200
[3] Object oriented programming: operator overloading and temporary objects
Section 5 operators and operator overloading
In C + +, the operator itself is a function that can be customized by users. Then we think that the calculation of complex numbers is not as good as using the + sign directly, and the concept and operation rules of the + sign need operator overloading.
Operator overloading can be written in two way ...
Added by srdva59 on Mon, 21 Feb 2022 13:03:14 +0200
java backend to achieve addition, subtraction, multiplication, division and proportion calculation
java backend to achieve addition, subtraction, multiplication, division and proportion calculation
In Java The math package provides the API class BigDecimal, which is used to accurately calculate the number of more than 16 significant bits. BigDecimal creates objects, so you cannot directly perform mathematical operations on its objects using ...
Added by hashim on Mon, 21 Feb 2022 10:58:19 +0200
Two implementations and performance comparison of Android barrage -- custom LayoutManager
IntroductionIn the previous article, the "animation" scheme was used to realize the bullet screen effect. The container control was customized. Each bullet screen was used as its sub control, and the initial position of the bullet screen was placed outside the right side of the container control. Each bullet screen was translated thro ...
Added by skeetley on Mon, 21 Feb 2022 10:06:57 +0200
muduo library net source code analysis III (timer)
Enables EventLoop to handle timer events
Timing function
Used to make the program wait for a period of time or schedule a scheduled task:
sleep
alarm usleep
nanosleep
clock_nanosleep
getitimer / setitimer
timer_create / timer_settime / timer_gettime / timer_delete
timerfd_create / timerfd_gettime / timerfd_settime chooses this method. ...
Added by Ixplodestuff8 on Mon, 21 Feb 2022 08:34:16 +0200
Template of C + + foundation
Generic Programming
When learning function overloading before, we wrote a Swap function Swap
void Swap(int& left, int& right)
{
int tmp = left;
left = right;
right = tmp;
}
void Swap(char& left, char& right)
{
char tmp = left;
left = right;
right = tmp;
}
void Swap(double& left, double& right)
{
double tmp ...
Added by 6pandn21 on Mon, 21 Feb 2022 07:29:58 +0200