Java programming Chapter Three——Array

Array

1. The concept of array is simply that array can store multiple data of the same type at the same time, and can operate these variables uniformly.

2. Key features (1) Same type (2) Length

3. Basic process of using array: Declaration: specify the type of data to be stored and the name of array; Allocate space: specify the length of array and use the data in array

4. Write a declaration array: Specify the type of stored data and the name of the array. Data type \[\] Array name; (Suggested writing) can also be written as: Data type \[\] array name; Data type array name \[\];

5. Allocate space: specify the length of the array.Array name =new data type length; Note: The array cannot be used until the length is specified.

Example:

相关推荐
小新11013 分钟前
qt creator 将qInfo的输出日志写入日志文档,方便查看
开发语言·qt
我材不敲代码1 小时前
Python 函数核心:位置参数与关键字参数详解
java·前端·python
hssfscv1 小时前
QT的学习记录1
开发语言·qt·学习
SunnyDays10111 小时前
Python操作Excel批注:从基础添加到高级自定义的完整指南
开发语言·python·excel
Yyyyyy~1 小时前
【C++】数组篇
开发语言·c++
qq_333120971 小时前
C++高并发内存池的整体设计和实现思路_C 语言
java·c语言·c++
牛肉在哪里1 小时前
ros2 从零开始27 编写广播C++
开发语言·c++·机器人
mh_f1 小时前
33.批量通过GET链接下载图片到指定文件夹下
java
金銀銅鐵1 小时前
[Java] 如何理解 class 文件中方法的 access flags?
java·后端
智研数智工坊1 小时前
SpringBoot4.0.6 + Security7.x + JWT 最新完整实战|无状态权限认证、统一异常处理、可直接落地
java·spring boot·spring security·jwt·权限认证