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

java process control

java process control 1, Scanner object Basic grammar Get the input string through the next() and nextLine() methods of the Scanner class. Before reading, we generally need to use hasNext and hasNextLine to judge whether there is still input data public static void main(String[] args) { //Create a scanner object to receive keyboard data ...

Added by waldo on Fri, 31 Dec 2021 20:51:53 +0200

[C language] from introduction to penetration (branch and loop statements)

preface: This article explains the use of branch statements and loop statements to clarify the branches and loops. 1, Statement c language is a structured programming language. There are three structures in c language: Sequential structure (from top to bottom)Select structure (if, switch)Loop structure (while, for, do... While) W ...

Added by Mr_jmm on Fri, 31 Dec 2021 16:55:53 +0200

On C + + callback function (callback) concise and practical

1 about callback functions 1.1 definitions The definition of callback function can be very strict (complex) or simple (random). In fact, instead of studying the definition, it's better to discuss why callback function is needed and what callback function can do. In my opinion, callback functions are not different from ordinary functions in th ...

Added by matijarma on Thu, 30 Dec 2021 23:06:04 +0200

A first look at the function of logging net (Async)

1. Write in front I've been studying the code of our products recently, In some functions Asynchrony has been used in (for example, warehousing), but it has not been studied in detail for so long. Many popular explanations of relevant contents on the Internet are based on life examples such as making tea and washing clothes. Personally, I thin ...

Added by dcmbrown on Thu, 30 Dec 2021 21:42:53 +0200

Design pattern - template method pattern

Related links: [design mode] column: [design mode] column Relevant examples can be downloaded: Examples of common Java design patterns Template method pattern Template Method Pattern defines the algorithm skeleton in an operation, and delays some steps of the algorithm to subclasses, so that subclasses can redefine some specific steps of ...

Added by Fed51 on Thu, 30 Dec 2021 10:27:58 +0200

[C language] from introduction to penetration (function)

preface: This article explains to you how to master the basic use and recursion of functions. C language function is a function used to compile c language, generally including character library function, mathematical function, directory function, process function, diagnosis function, operation function, etc. "Function" is tra ...

Added by JamesU2002 on Thu, 30 Dec 2021 07:08:19 +0200

Introduction to java -- Enumeration

Introduction to java -- Enumeration concept enumeration is a new feature introduced in JDK 1.5 grammar public enum Color{ //Add public static final Color by default RED,GREEN,BLUE; } essence Enumeration is a restricted class and has its own methods. When you create your own enum class, this class inherits from Java lang.Enum ...

Added by dotwebbie on Thu, 30 Dec 2021 05:50:51 +0200

Eh, Java is so particular about splitting a string

When it comes to Java splitting strings, I guess nine times out of ten you will make a cruel remark, "what's the difficulty? Just go to the split() method of String class!" If you really think so, you should pay attention. Things are far from so simple. Come on, move a small bench and sit down. If there is such a string of chara ...

Added by Goofan on Thu, 30 Dec 2021 05:15:04 +0200

16 dynamic graphs: a Python visualization tool that is easy to use

Generally speaking, when it comes to data visualization, Python readers may think of matplotlib module or seaborn module for the first time, while when it comes to drawing dynamic charts, they think more of Plotly or pyechards. Today, I'd like to introduce another module for drawing dynamic charts, which is very convenient to use, and the c ...

Added by mattee on Thu, 30 Dec 2021 00:52:21 +0200