Netease Java Post Recruitment Interview Experience Sharing

Netease interview questions

  1. What are the characteristics of object-oriented?

  2. List several commonly used packages in java and their functions

  3. What is the connection and difference between interface and abstract class

  4. What is the difference between overloading and overriding

  5. What are the basic data types in java?

  6. What are the data types supported by Java? What is automatic unboxing?

  7. What is the difference between int and Integer

  8. Does an array have a length() method? Does String have a length() method?

  9. What is the difference between the symbols >> and >>> in Java?

  10. Java class instantiation order

  11. What is pass by value and pass by reference

(1) Value transfer is for basic variables, and what is transferred is a copy of the variable, and changing the copy does not affect the original variable.

(2) Passing by reference is generally for object variables, and what is passed is a copy of the address of the object, not the original object itself.

  1. Can String be inherited? Why?

  2. The difference between String and StringBuilder, StringBuffer?

  3. What are the basic interfaces of the Java collection framework?

  4. What is the Java Collections Framework? Name some advantages of the collection framework?

(1) There are collections in every programming language, and the initial Java version contains several collection classes: Vector, Stack, HashTable, and Array. With the widespread use of collections, Java 1.2 proposed a collection framework that includes all collection interfaces, implementations, and algorithms. Java has come a long way in using generics and concurrent collection classes while ensuring thread safety. It also includes, in the Java Concurrency Package, blocking interfaces and their implementations.

(2) Some of the advantages of the collection framework are as follows:

• Reduce development costs by using core collection classes instead of implementing our own collection classes.

• Code quality improves with the use of rigorously tested collection framework classes.

•By using the collection classes that come with the JDK, code maintenance costs can be reduced.

• Reusability and operability.

  1. What is the difference between HashMap and HashTable

  2. What is the difference between ArrayList and LinkedList?

  3. A brief introduction to the Java exception framework

  4. What is the difference between throw and throws keywords in java?

  5. List a few common runtime exceptions?

  6. What is the difference between final, finally, finalize

  7. Describe the Java memory model

The Java virtual machine specification divides Java runtime data into six types:

(1) Program counter: It is a data structure used to save the memory address of the currently executing program. The multi-threading of the Java virtual machine is realized by switching threads in turn and allocating processor time. In order to restore the correct position after thread switching, each thread needs an independent program counter, which does not affect each other. This area is " thread-private".

(2) Java virtual machine stack: thread-private, the same as the thread life cycle, used to store local variable tables, operate stacks, and method return values. The local variable table holds basic data types, as well as references to objects.

(3) Native method stack: It is very similar to the virtual machine stack, but it serves the Native method used by the virtual machine.

(4) Java heap: A memory area shared by all threads, where almost all object instances allocate memory.

(5) Method area: the area shared by each thread, storing class information loaded by the virtual machine, constants, static variables, and compiled code.

(6) Runtime constant pool: represents the constant table in each class file at runtime. Contains several types of constants: compile-time numeric constants, method or field references.

  1. What are the methods of garbage collection in java?

  2. Common Garbage Collection Algorithms

(1) Mark-Clear (Mark-Sweep) algorithm

(2) Copy algorithm

(3) Mark-Compact (Mark-Compact) algorithm

  1. How to judge whether an object can be recycled in JVM GC?

Because the platform cannot directly send interview materials and other reasons, friends who need this Netease face-to-face learning study notes only need to comment + forward + follow, and send a private letter to the author to reply [666] to get the answers to the above interview questions and study materials for free

Guess you like

Origin blog.csdn.net/l688899886/article/details/126752516