Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Java often meets with each other to share test questions.

Shulou Source: shulou.com Published: 2022-06-02 09:20:28 09月29日 Update

This article mainly explains "java common meeting test questions sharing". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "java common meeting test questions sharing" together!

1. Java thread pool has several types

Java provides four thread pools through Executors:

newCachedThreadPool creates a cacheable thread pool. If the thread pool length exceeds the processing needs, idle threads can be recycled flexibly. If there is no recycling, new threads will be created.

newFixedThreadPool creates a fixed-length thread pool that controls the maximum number of concurrent threads. Exceeding threads will wait in the queue.

newScheduled ThreadPool Creates a fixed-length thread pool that supports timed and periodic task execution

newSingleThreadExecutor creates a single-threaded thread pool that uses only one worker thread to execute tasks, ensuring that all tasks are executed in the specified order (FIFO, LIFO, priority).

2. Principle of HashMap

A: Calculate the storage space of value by hashcode() of key.

3. What does hashcode() in Object return?

A: Returns the integer form of the memory address where the object is located

4. Calendar of map?

Answer: Map provided

(1)set keyset= map.keyset(),

(2)set entrySet= map.entryset();(Encapsulate all key-value pairs in map into Entry object and put them into set)

5. Springboot's startup process

(1)main

(2) Load configuration: The annotated class is equal to the XML configuration file (applicationContext.xml) of spring, assembling all bean transactions, providing a context environment for spring.

(3) Component scanning: component scanning, can automatically discover and assemble beans

Thank you for reading, the above is the content of "java common test questions sharing", after the study of this article, I believe that everyone has a deeper understanding of java common test questions sharing, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Threads questions tasks learning content objects components fixed length assembly up and down context transaction priority memory principle cycle periodicity address that is form Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Docker Shulou Technology Xiaomi