课程: Java for All Platforms: Desktop, Web, and Mobile Development
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Arrays and lists - Java教程
课程: Java for All Platforms: Desktop, Web, and Mobile Development
Arrays and lists
- [Instructor] Arrays are a key staple of any programming language and of course, Java is no different. If you're unfamiliar with arrays you can think of them as a numbered list of items. Each item has its associated numeric slot starting with zero and then going up. So let's say we want to create an array of strings. Type the keyword String with a capital S and we say that this is a string array by typing square brackets after the array's data type. Follow that with the name of the array. So I'll call this myArray. And then one way to create an array is to use the new keyword and then String and square brackets followed by a semicolon. When you create an array in Java, you actually need to know how many items are going to be in the array. So let's say I'm going to put three items in the array. I put a three in the brackets there. So that's saying create a new three item array that will hold only strings. So go to…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
(已锁定)
Variables4 分钟 4 秒
-
(已锁定)
Functions4 分钟 40 秒
-
(已锁定)
Arrays and lists6 分钟 17 秒
-
(已锁定)
Conditional statements3 分钟 45 秒
-
(已锁定)
Classes and packages6 分钟 14 秒
-
(已锁定)
Input and output2 分钟 26 秒
-
(已锁定)
Read data from a file4 分钟 12 秒
-
(已锁定)
Handle Java errors3 分钟 26 秒
-
(已锁定)
Challenge: Sum of a list54 秒
-
(已锁定)
-
-
-
-
-