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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),