Interview frequency: what is the relationship between hashCode() and equals()?

First offer a picture, you can think about why? introduce equals() is used to determine whether two objects are equal. hashCode() is used to obtain hash code, also known as hash code; It actually returns an int integer. This hash code is used to determine the index position of the object in the hash table. relationship We use "class ...

Added by vronsky on Fri, 31 Dec 2021 21:30:51 +0200

Is it still necessary to learn JSP in 2020?, Necessary magic weapon to BAT

Now the question comes. Is JSP really old in 2020? Yes, it's really old Now the question comes again. Why is the technology that has been defined as "old" a few years ago still hot by 2020? Every year, someone still asks, "do you still need to learn jsp?". I think the reason is also very simple: JSP was really used before! ...

Added by greepit on Fri, 31 Dec 2021 06:51:29 +0200

Design mode - sharing mode

Sharing element mode Object oriented technology can solve some flexibility and scalability problems, but in many cases, it is necessary to increase the number of classes and objects in the system. When there are too many objects, the running cost will be too high, resulting in performance degradation and other problems. Xiangyuan mode was offi ...

Added by saeed42 on Fri, 31 Dec 2021 04:58:19 +0200

Singleton mode recording

Full Han model Full Han is the single case model with the most varieties. Starting from the full Han Dynasty, we gradually understand the problems we need to pay attention to when implementing the singleton mode through its variants. Basic satiated man A full man is one who is already full and eats when he is not in a hurry. He eats when he ...

Added by bsgrules on Thu, 30 Dec 2021 21:14:51 +0200

Spring Interview Requirements-Circular Dependency

1. What is circular dependency 1.1 Overview Circular dependency is the interdependence between different objects. For example, A-like constructors depend on B instances, B-like constructors depend on A instances, so Spring needs to inject B instances when initializing A instances, then B instances need to be taken from containers, then B inst ...

Added by gfoot on Thu, 30 Dec 2021 18:06:39 +0200

[classic topics] classics in Classics -- TopK problem

Problem introduction Please find the minimum / maximum number of k in a pile of data. The title description is very simple. How many ideas do you have to realize it?     Solution 1 - simple sorting First of all, you can think of a very simple idea: sort the data from small to large, and take the first k numbers. Don't go into details, jus ...

Added by jeny on Thu, 30 Dec 2021 17:49:56 +0200

Tencent background development Java post: comprehensive analysis of Java intermediate and advanced core knowledge

It's very simple here. Only one is maintained internally `byte` Type `data` Array, actually `byte` It still occupies as much as one byte and can be optimized into `bit`Instead, it is only used to facilitate simulation. In addition, I created three different`hash`Function is actually a reference`HashMap`Hash jitter method, respectively, using it ...

Added by lupld on Thu, 30 Dec 2021 06:13:50 +0200

Redis cache: ten thousand words long! Starting from the bottom, it will take you to understand concurrent programming

![](https://upload-images.jianshu.io/upload_images/24195226-95f672f1095c9a4c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) We all know`StringBuffer`It is thread safe because its key methods are added`synchronized`,However, it can be seen from the print result that the lock is eliminated. because`buffer`This reference will only be ...

Added by hollyspringer on Thu, 30 Dec 2021 04:48:40 +0200

Spring framework entry foundation, hard work for a month

decoupling Just now we said that the creation of resources was entrusted to sring. We can find spring for what we need. This process is like a factory model. But what objects it needs to create in the spring framework, it needs a configuration file. This configuration file tells spring which resources need to be created. For example, su ...

Added by ma9ic on Thu, 30 Dec 2021 01:29:56 +0200

Daniel, teach you hand in hand! Spring MVC - Crazy God notes

Write web XML, register DispatcherServlet Writing spring MVC configuration files The next step is to create the corresponding control class, controller Finally, improve the correspondence between the front-end view and the controller (the parameters of Model type are declared in the method to bring the data in the Action to the view) Test ...

Added by hawkeyes on Wed, 29 Dec 2021 21:12:48 +0200