I joined Ali P8 at the age of 35+ when I was supposed to be shot, and I have never left the frontline for more than ten years. At the same time, as a certified interviewer of a major factory, I have seen various candidates in actual recruitment, and their failure and success experience can give you some reference.
Share some of the interview questions that I have examined in the interview. For detailed analysis, you can also move to the free trial listening of "Java Senior Engineer" I lectured .
There are 3 Java back-ends, a very good guy recruited by the undergraduate school.
What is the difference between JDK and JRE?
Answer: Specifically, JDK actually includes JRE, as well as Javac, a compiler for compiling Java source code, as well as many tools for debugging and analyzing Java programs. To put it simply: if you need to run a Java program, you only need to install the JRE. If you need to write a Java program, you need to install the JDK.
Ask another question: What other command-line tools do you know besides javac, and what are their uses?
Jcmd: Comprehensive tool
jps: virtual machine process status tool
jinfo jstat: virtual machine statistics monitoring tool
jinfo: Java configuration information tool
jmap: Java memory mapping tool
jhat: virtual machine heap dump snapshot analysis tool
jstack: Java stack trace tool
Follow-up: Have you used jstat? What parameters do you know?
……
In fact, it is not difficult to pick up these questions individually. The main reason is to have an in-depth understanding of the technology stack and principles, to form a system and a structure, and to answer in an orderly manner in the face of the interviewer's in-depth cross-examination.
At this level, it will almost pass.
Java is two-sided, a veteran who has worked for 3 years, the technology is not very solid
This little brother didn't answer very well, so I will put the "reference answer" directly for everyone.
Q: What is the difference between == and equals?
**Key points of the answer: ** Both methods are relatively equivalent. The difference between them should be seen from the "basic type" and "reference type". As a basic type, they compare values. As a reference type-object, they compare whether the two sides are the same object.
**Inspection point: **Basic types & reference types
Basic type: compare whether the values are the same
Reference type: compare whether the references are the same
The native implementation of equals() can directly define the relationship between them:
Bonus Tips:
Of course, we can implement a custom equivalent calculation method by overloading the equals method in Oblect. For example, in the String type, because the method is reimplemented in the source code, the following result will be produced:
Tips: The content of String instantiated with string constants is actually kept in the constant area
String x = “string”;
String y = “string”;
x==y ——> true
All referenced are the same data item in the constant area, so there is the above result
**Review point: **The concept of equals()
**Practical requirements: **Usually deep digging awareness of source code is technical research and critical thinking
The above topics have such characteristics:
1. They are all textbook-level topics
2. They are commonly used in engineering practice
3. They are all used to it, not easy to take the initiative to study deeply
Purpose of the investigation:
1. The solidity of basic knowledge
2. The candidate's enthusiasm for technology
For more Java interview knowledge points and investigation methods, I explained it very clearly in the lecture of "Java Senior Engineer P6+" , and interested students can click for free trial listening experience.
I hope you become a qualified Java engineer~