La7.1 JavaArray
La7.1 JavaArray
1.
Target
2.
Background
At this session, we will be discussing about arrat at Java. First, we will
be definiting what array is, and then we will be definiting how to declarating and
using it at Java.
At before, we have been discusing how to declarates varies of variable
with using primitive data type. At declaring of variable, we often to sue a data
type along with the name of variable or unique identifier, where to using that
variable, we will be calling with identifiers name.
As a sample, we have 3 variables with int data type that have a different
identifier for each variable.
int number1;
int number2;
int number3;
number1 = 1;
number2 = 2;
number3 = 3;
As u can see at the sample above, just for initialitation and using
variable especially in the same purpose, feel so confusing. In Java or in the other
programming language, they have ability to using one variable that can storing a
data list and then manipulating it to more effective. This stype of variable hat
called.
Versi 1.2
1 | Page
3.
Experiment
Versi 1.2
2 | Page
//
karakter array 8 x 16 x 24
char[][][] threeD = new char[8][16][24];
//
Versi 1.2
3 | Page
4.
Exercise
Gunakan while-loop, kemudian print semua nilai dari array (Gunakan juga untuk dowhile dan for-loop)Using a while-loop.
Versi 1.2
4 | Page
Name : Florence
Tel. #
: 735-1234
Address
: Manila
Name : Joyce
Tel. #
: 983-3333
Address
: Quezon City
Name : Becca
Tel. #
: 456-3322
Address
: Manila
Versi 1.2
5 | Page