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:

相关推荐
叼烟扛炮1 小时前
C++第八讲:string 类
开发语言·c++·算法·string
努力努力再努力wz1 小时前
【Qt入门系列】第一个 Qt Widgets 程序:项目创建、UI 文件、Hello World、对象树与 qDebug 日志
java·c语言·开发语言·数据结构·c++·qt·ui
电子云与长程纠缠1 小时前
UE5 GameFeature创建与使用
开发语言·学习·ue5·游戏引擎
东南门吹雪1 小时前
Spring事务传播机制深度解析
java·数据库·spring
_Evan_Yao2 小时前
零基础学编程,第一门语言选Python还是C?
c语言·开发语言·python
XS0301062 小时前
Java基础 List集合
java·windows·list
凤凰院凶涛QAQ2 小时前
《C++转Java快速入手系列》抽象类和接口篇
java·开发语言·c++
MuYiLuck2 小时前
01-spring-boot-autoconfig-principle
java·spring·maven·自动配置