The most crucial knowledge point in Java

zhaozj2021-02-16  62

I want to be a Java master, you are at least very familiar with and can apply as follows:

1. Serialization mechanism. (Some people think it is not an important technology, I declare my experience, this is the first important knowledge point for the Java platform.)

2.RTTI mechanism

3.Callback mechanism

4. Reflex mechanism

Serialization:

It is all the object depth clone, the object's storage and recovery, the basis of remote call of the object, that is, it is the foundation of object pool management, distributed reference, think about what J2EE platform does not rely on it?

RTTI:

It is the foundation of all packages, without it, interface, abstract class, parent class is meaningless, if the package is not, there is no parent class, the subclass is not called.

Callback:

Callback is first based on multi-threaded. Do not talk about callback without threads. Subclass calls the parent class constructor called back call, the TMD's constructive object is called, because any object has inherited at least Object, when constructed At least the configuration method of the Object is to be invoked.

Callback mechanism:

When a primary thread manages other threads, no polling method checks the status of each thread, but notifies the main thread when there is a state in the sub-thread, ah, someone wants to press me, ah, my value arrived 100. (Terminology Triggering something) This main thread receives these messages and then calls the corresponding method according to the message type.

An example, I (main thread) go to Beijing, when the car went to Beijing, I would like to call the method of "getting off". If I don't need a callback mechanism, I will continue to ask Driver. If I ask more than three times That Driver is better than me, he must hit me, if you use a callback mechanism, you use a sub-thread (you can take this role) in that, when you want to inform me, I will call " Get off () ", don't have to take a while, so I can save time to sleep or chat with the crush on the car.

reflection:

It is Runtime, complete the product, the class analysis, bean's self-provision, and the number of JBuilders listed it after the name of the class lists its member variables and methods for you? If you want to know a object How many methods do you use? These knowledge allow you to analyze the error from a line of Exception. And implement ClassLoader, security management, etc.

These just talk from simple aspects, in fact, every knowledge point / "dissolution /" will involve more knowledge points, everyone understands it.

转载请注明原文地址:https://www.9cbs.com/read-17981.html

New Post(0)