javaarray.pdf
(
247 KB
)
Pobierz
623026934 UNPDF
Java Array
1
Agenda
●
What is an array
●
Declaration of an array
●
Instantiation of an array
●
Accessing array element
●
Array length
●
Multi-dimensional array
2
What is an Array?
3
Introduction to Arrays
●
Suppose we have here three variables of type int with
different identifiers for each variable.
int number1;
int number2;
int number3;
number1 = 1;
number2 = 2;
number3 = 3;
As you can see, it seems like a tedious task in order to just
initialize and use the variables especially if they are used for
the same purpose.
4
Introduction to Arrays
●
In Java and other programming languages, there is one
capability wherein we can use one variable to store a list of
data and manipulate them more efficiently. This type of
variable is called an array.
●
An array stores multiple data items of the same data type, in
a contiguous block of memory, divided into a number of
slots.
5
Plik z chomika:
mystiqal
Inne pliki z tego folderu:
1-javaprogbasics.pdf
(390 KB)
2-javainputkey.pdf
(227 KB)
3-javacontrol.pdf
(370 KB)
commandarguments.pdf
(492 KB)
GCIntro.pdf
(261 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin