Multithreading: thread creation and thread safety

Article directory Program, process, thread Create thread Startup thread Thread safety To solve the problem of thread safety (to realize Runnable) -- synchronous code block To solve the problem of thread safety (to realize Runnable) -- synchronization method To solve the Thread safety problem (inhe ...

Posted by surreal5335 on Wed, 26 Feb 2020 20:25:07 -0800

Java basic programming structure

Sketch Java originated from Oak, a development language developed by Sun company for set-top box, which was renamed "Java" because of its name. Java is an object-oriented development language. Its characteristic is "compile once, run everywhere". This implementation depends on JVM. Basic design of Java program A basic Java ...

Posted by eelmitchell on Sat, 22 Feb 2020 03:13:30 -0800

Java object oriented

Java objects are instances of the Object class, so you can directly call the methods defined in the class toString() class Person { private String name; public Person(String name) { this.name = name; } } public class PrintObject { public static void main(String[] args) { ...

Posted by Nicholas Reed on Fri, 21 Feb 2020 05:11:18 -0800

Exception mechanism (exception classification and handling, getMessage,printStackTrace)

(all screenshots in the figure, as well as data notes, come from the power node, for self-study and use) 1. What is the exception? First, abnormal simulation is "abnormal" events in the real world Second, in java, exceptions are simulated by means of "classes" Exception description u ...

Posted by lixid on Fri, 21 Feb 2020 02:58:19 -0800

How do I use stacktrace or reflection to find the caller of a method?

I need to find a caller for a method.Can stacktrace or reflection be used? #1st floor This is part of the code that I wrote based on the tips shown in this topic.Hope to help you. (Please let me know if you have any suggestions to improve this code) Counter: public class InstanceCount{ private static Map<Integer, CounterIn ...

Posted by redking on Thu, 20 Feb 2020 18:09:37 -0800

Reflection mechanism and Demo in java

I. reflection Reflection mechanism is the most commonly used in java development. For example, reflection mechanism is used in all three frameworks. JAVA reflection mechanism is in the running state. For any class, you can know all the properties and methods of this class. For any object, you can ca ...

Posted by mmoussa on Tue, 18 Feb 2020 21:36:16 -0800

Flink1.9“Error: A JNI error has occurred”

background Recently, companies are building big data systems, and architects recommend using Flink to build them.So this day, I'm investigating Flink in my own virtual machine environment (Ubuntu 16.4). from ververica I learned the fundamentals of flink in school, because I worked on python data pr ...

Posted by aperales10 on Sun, 16 Feb 2020 18:33:05 -0800

HashSet and list performance

Obviously, the search performance of the general HashSet < T > class is higher than that of the general list < T > class. Just compare the hash based key with the linear method in the list < T > class. However, it may take some CPU cycles to calculate the hash key itself, so for a small number of items, linear search can r ...

Posted by Cagez on Sat, 15 Feb 2020 02:03:50 -0800

Dynamic agents you have to learn

Dynamic agents you have to learn Background of problem What are the problems? Solution Mode explanation New problems Principle of dynamic agent Related development Background of problem As a senior single dog, Xiaoqiang has finally ushered in her own spring. Under his relentless pursuit, Xiao Li ...

Posted by tsabar on Wed, 12 Feb 2020 04:38:18 -0800

[JAVA programming] JAVA assist summary

Javaassist reference manual 1. Read and output bytecode 2. New Class 3. Freeze Class 4. Class search path 5,ClassPool 6,Class loader 7. Introduction and customization 8. Modify method body 9 add a new method or field 10 notes 11 javassist.runtime 12 import 1. Read and output bytecode ClassPool ...

Posted by erupt on Tue, 11 Feb 2020 22:05:12 -0800