1. Relationship description
(1) Array
The array is a reference data type, and the array reference variable is just a reference (similar to the pointer in C ), array elements and array variables are in memory
(2) Object array
Since classes and arrays are both reference data types, the object array o2 in the program actually stores Reference array of class Obj.
(3) Multidimensional array
A multidimensional array is an extension of an array. It is essentially a one-dimensional array, but the array elements are also references, and the references saved in the array elements point to the one-dimensional array.
2. Example
public class Obj{ int a; } public class Test{ public static void main(String[] args){ int array[] = int[]{2,3,4,5,6,7,8,9}; Obj o1 = new Obj(); Obj o2[] = new Obj[10]; int array2[][] = new int[10][]; } }
What collection classes are there in Java?
Collections in Java are mainly divided into four categories:
1 , List list: ordered, repeatable;
2, Queue queue: ordered, repeatable;
3, Set collection: non-repeatable;
4. Map mapping: unordered, unique keys, but not unique values.
The above is the detailed content of Detailed explanation of the relationship between Java array types. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version
SublimeText3 Linux latest version

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Notepad++7.3.1
Easy-to-use and free code editor