| A[0] | A[1] | A[2] | A[3] | A[4] |
| 10 | 20 | 30 | 40 | 50 |
A. Array Satu-Dimensi.
int jmlHari[];
int jmlHari[]=new int[12];
jmlHari[0]= 31;
Latihan Lat019.java
public class Lat019
{
public static void main(String[] args)
{
int jmlHari[]=new int[12];
jmlHari[0]=31;
jmlHari[1]=28;
jmlHari[2]=31;
jmlHari[3]=30;
jmlHari[4]=31;
jmlHari[5]=30;
jmlHari[6]=31;
jmlHari[7]=31;
jmlHari[8]=30;
jmlHari[9]=31;
jmlHari[10]=30;
jmlHari[11]=31;
System.out.println(“Bulan Maret memiliki “+jmlHari[2]+” hari!”);
}
}
public class Lat019
{
public static void main(String[] args)
{
int jmlHari[]={31,28,31,30,31,30,31,31,30,31,30,31};
System.out.println(“Bulan Maret memiliki “+jmlHari[2]+” hari!”);
}
}
B. Array Multi-Dimensi.
tipe namaArray[][];
atau
tipe [][] namaArray;
Adapun untuk array 3 dimensi, bentuk umumnya sbb :
tipe namaArray[][][];
atau
tipe [][][] namaArray;
int duaD[][]=new int[2][3];
Apabila digambarkan, maka posisi dari setiap elemennya sbb :
| duaD[0][0] | duaD[0][1] | duaD[0][2] |
| duaD[1][0] | duaD[1][1] | duaD[1][2] |
Latihan Lat020.java
public class Lat020
{
public static void main(String[] args)
{
int duaD[][]=new int[2][3];
int k=1;
for(int i=0;i<2;i++)
{
for(int j=0;j<3;j++)
{
duaD[i][j]=k*10;
System.out.print(duaD[i][j]);
if (j<2) System.out.print(“ “);
k++;
}
System.out.println();
}
}
}
Kita juga dapat melakukan inisialisasi nilai pada array dua dimensi sbb:
public class Lat020
{
public static void main(String[] args)
{
int duaD[][]={{10,20,30},{40,50,60}};
for(int i=0;i<2;i++)
{
for(int j=0;j<3;j++)
{
System.out.print(duaD[i][j]);
if (j<2) System.out.print(“ “);
}
System.out.println();
}
}
}
by: Annisa Puspa K from google
This is Annisa Puspa Kirana personal site, thx for visiting my page... Lets Join at Google Plus Page atau lihat profile google saya di My Google Profile





















I have to express appreciation to this writer for bailing me out of such a predicament. Because of looking throughout the world-wide-web and getting concepts that were not powerful, I was thinking my life was well over. Being alive without the presence of answers to the issues you’ve resolved through the posting is a serious case, and those which may have negatively damaged my career if I had not encountered your site. Your main natural talent and kindness in playing with every aspect was helpful. I don’t know what I would have done if I had not come across such a stuff like this. I can also at this moment relish my future. Thanks very much for this skilled and result oriented help. I will not be reluctant to suggest your blog to any person who would need direction about this subject matter.
Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly comeback.
Heya i’m for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you helped me.
Wonderful beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog web site? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea
I’ll right away clutch your rss feed as I can not in finding your e-mail subscription link or e-newsletter service. Do you have any? Kindly let me understand in order that I may just subscribe. Thanks.
I like the helpful information you provide in your articles. I will bookmark your weblog and check again here regularly. I’m quite sure I will learn many new stuff right here! Best of luck for the next!
I’m still learning from you, but I’m making my way to the top as well. I absolutely liked reading everything that is posted on your site.Keep the information coming. I enjoyed it!
Awsome website! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also
Very well written post. It will be beneficial to anyone who utilizes it, including yours truly
. Keep doing what you are doing – can’r wait to read more posts.
I precisely needed to thank you very much once more. I am not sure what I might have carried out in the absence of these tips shared by you regarding such a theme. It was a very troublesome concern for me, however , observing the very professional fashion you resolved the issue took me to leap over fulfillment. Now i am thankful for the work and as well , believe you realize what a powerful job that you are accomplishing training men and women through your web page. Probably you’ve never come across all of us.
My brother suggested I might like this website. He was entirely right. This post actually made my day. You cann’t imagine simply how much time I had spent for this information! Thanks!
Hello there, You have done a fantastic job. I will definitely digg it and personally recommend to my friends. I’m sure they’ll be benefited from this web site.
Wow! Thank you! I continuously needed to write on my site something like that. Can I implement a fragment of your post to my site?
Great site! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also
I have to express my thanks to the writer just for bailing me out of this particular scenario. Just after scouting through the world-wide-web and getting strategies which are not productive, I figured my life was well over. Living minus the strategies to the problems you have sorted out by means of this guideline is a critical case, and those which could have negatively damaged my entire career if I hadn’t encountered your site. Your actual talents and kindness in playing with all the stuff was tremendous. I am not sure what I would’ve done if I had not come across such a point like this. I can also at this moment look ahead to my future. Thanks very much for the professional and sensible help. I won’t hesitate to propose your web blog to any individual who needs support about this issue.
I’m starting up a new internet website directory and was wondering if I can submit your site? I’m trying to grow my directory gradually by hand so that it maintains quality. I’ll make sure and put your website in the appropriate category and I’ll also use, “Array JAVApuspakirana.com” as your anchor text. Be sure to let me know if this is alright with you by e-mailing me at: johnlevy@live.fr . Thanks alot
Hello. splendid job. I did not expect this. This is a splendid story. Thanks!
I don’t even know how I ended up here, but I thought this post was good. I don’t know who you are but definitely you’re going to a famous blogger if you aren’t already
Cheers!