java reflection application foundation, super detailed
summary
Reflection is one of the features of Java programming language. It allows running Java programs to check themselves, or "self-examination", also known as "introspection". Reflection is so powerful that it can even directly manipulate the private properties of the program. We all have a concept in the previous study. ...
Posted by Hurklefish on Thu, 17 Feb 2022 14:28:32 +0100
I won't get off work until I finish this article on Java basics
TIP
This article is included in< Introduction · YuQue >For more in-depth articles, please go to< Introduction · YuQue> .
data type
There are eight basic data types in the Java language:
boolean/1byte/8char/16short/16int/32float/32long/64double/64
The eight basic data types are divided into four categories:
...
Posted by lisa71283 on Thu, 17 Feb 2022 13:41:46 +0100
Java encapsulation, inheritance and polymorphism
encapsulation
Example:
//student class
public class Student {
//Property private get/set
private String name;
private int age;
private char sex;
//Provide some public get and set methods
//get this data
public String getName() {
return this.name;
}
//set assigns a value to this property
public void setName(String name) {
this ...
Posted by sunil.23413 on Thu, 17 Feb 2022 10:42:21 +0100
Chat thread pool ThreadPoolExecutor
problem
Let's talk about three questions first and look at the source code with questions:
How does the thread pool keep the core thread from dying?If the number of core threads is 0, will new tasks be queued first or run directly? Will the process pool eventually die out?Allow the core thread to timeout. Where is the impact point
Examples
...
Posted by rayk on Thu, 17 Feb 2022 07:55:52 +0100
Sequential consumption of RocketMQ MessageListenerOrderly()
consumer.registerMessageListener(new MessageListenerOrderly() {
@Override
public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) {
for (MessageExt msg : msgs) {
System.out.println(new String(msg.getBody())+" Thread:"+Thread.currentThread( ...
Posted by gvanaco on Thu, 17 Feb 2022 07:29:29 +0100
Java programming ideas Chapter 10 internal classes
Inner class: put the definition of one class inside the definition of another class. Advantages: organize some logically related classes together (elegant and clear), and control the visibility of internal classes.
10.1 creating internal classes
Put the definition of the class inside the peripheral class
public class Parcel1 {
class Des ...
Posted by tranzparency on Thu, 17 Feb 2022 05:35:31 +0100
C + + right value reference
Concept of right value reference
Book back: C + + implementation of MyString.
Continue to use the MyString code here
int main()
{
String s1;
s1 = fun();
int a = 10;
int& b = a;
//int&& c = a; Error!!! Only right values can be referenced
int&& c = 10;//Only r-values can be referenced. Numeric constants are pure ...
Posted by spillage on Thu, 17 Feb 2022 00:25:56 +0100
[Flask] use of Flask Sqlalchemy
The use of flask SQLAlchemy encapsulates and optimizes SQLAlchemy:
Flask Sqlalchemy is a plug-in of the flask frameworkFlask SQLAlchemy is a plug-in that simply encapsulates SQLAlchemyIt makes it easier for us to use sqlalchemy in Flask.
1. Installation:
pip install flask-sqlalchemy
2. Key points of using flask Sqlalchemy:
2.1 database co ...
Posted by upit on Thu, 17 Feb 2022 00:07:03 +0100
XII [Java] object oriented abstract classes and abstract methods
catalogue
01 abstract class
1.1 examples of abstract application scenarios
1.2 abstract precautions
1.3 practice of abstract class
1.4 anonymous subclasses of abstract classes
1.5 concrete application of abstraction: template method
1.6 practice of abstract class
01 abstract class
With the definition of new subclasses in the inherit ...
Posted by cabldawg on Wed, 16 Feb 2022 22:54:58 +0100
How is the condition in AQS implemented
Function of condition
In fact, there are many usage scenarios of condition, which can be used in concurrent scenarios involving condition judgment, such as:
Judge whether the queue is full or empty in the ArrayBlockingQueue of the blocking queueBlock and wake up all threads in CyclicBarrierJudgment of blocking access queue data in DelayQueueC ...
Posted by umguy on Wed, 16 Feb 2022 15:12:48 +0100