search
HomeJavaJavaInterview questionsJava interview questions summarized from many years of development experience - (4)

Java interview questions summarized from many years of development experience - (4)

1. The operation efficiency of the two structures of Java array and linked list

The array has high efficiency. The bottom layer of the array is a continuous memory space. According to the base address and offset The amount of the address is calculated;

The data in the linked list is found by pointing the address to the next data address;

(more interview question recommendations: java common interview questions)

2. What are the reference types in Java?

Strong reference, weak reference, soft reference, virtual reference

3. Storage performance and characteristics of ArrayList, Vector and LinkedList

ArrayList stores objects in the form of arrays because It is stored in a continuous position, making insertion and deletion troublesome, but the query efficiency is high, and the continuous array is ordered and can be searched according to the index;

(recommended related tutorials: java introductory tutorial)

LinkedList stores objects in independent spaces. Each space retains the index of the next link. The query efficiency is low, but the modification and deletion efficiency is high.

Vector uses the Synchronized method (thread safety) ), the performance is lower than ArrayList

4. Do List, Set and Map inherit from Collection interface?

List, Set is, Map is not

5. What are the characteristics of each of the three interfaces List, Map and Set when accessing elements?

(Video tutorial recommendation: java course)

List allows data to be repeated and ordered. Call get(index i) to clearly indicate which number to take.

Set does not allow repeated data and has internal sorting. It can only obtain all elements through the Iterator interface and then iterate through each element one by one.

Map stores data through key-value pairs. The key is unique and the same data will be overwritten. Use the get(Object key) method to obtain the corresponding value based on the key.

The above is the detailed content of Java interview questions summarized from many years of development experience - (4). For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use