Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the Java interview questions and answers?

Shulou Source: shulou.com Published: 2022-06-01 04:59:20 10月04日 Update

This article mainly explains "what are the questions and answers to the Java interview". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the questions and answers to the Java interview?"

1. How to judge whether an object should be recycled or not?

There are generally two ways. One is the reference counting method, and the other is the reachability analysis algorithm. The disadvantage of reference counting is that objects that reference each other cannot be cleared, so JVM generally uses reachability analysis algorithms to determine whether objects should be recycled.

2. What are the disadvantages of the replication algorithm? Because the replication algorithm needs to copy the surviving objects to another blank area, the utilization rate of memory is relatively low, which is its disadvantage.

3. Thread pool principle Java thread pool implementation principle and its practice in Meituan business

4, the principle of inverted indexing full-text search engine Elasticsearch, this article has been explained thoroughly!

5. What are the node types in Zookeeper? learn about ZooKeeper in 10 minutes.

6. How does Zookeeper implement distributed locks? please don't ask me how Zookeeper implements distributed locks!

7. What is the difference between static methods and non-static methods when synchronized is added? When added to a static method, the Class object is locked. When added to a non-static method, the lock is the this object, which is the current object.

8. ACID attribute atomicity (Atomicity) of a transaction means that the transaction is an indivisible unit of work, and either all the operations in the transaction occur or do not occur. Consistency) the integrity of the data must be consistent before and after the transaction. The isolation of Isolation transactions is that when multiple users visit the database concurrently, the transactions opened by the database for each user cannot be disturbed by the operation data of other transactions, and multiple concurrent transactions should be isolated from each other. Durability persistence means that once a transaction is committed, its changes to the data in the database are permanent, and then even if the database fails, it should not have any impact on it. Thank you for your reading, the above is the content of "what are the questions and answers to the Java interview?" after the study of this article, I believe you have a deeper understanding of the questions and answers of the Java interview, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Transactions objects data methods answers questions databases algorithms static principles shortcomings learning isolation consistency content distributed atomic reachability multiple that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft MariaDB Redmi macOS Xiaomi