Array di java, ntah ne array berapa gak tw??:D

hari sabtu ini benar2 menyedihkan untukku bukan masalah pacar(coz belum pnya) atau apa-apa.cuman gara-gara dimarahi ibuku untuk itu aku share buat para begginer java…

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;

public class ArrayKu3{
public void buatArray(){

//String name = “Yaniar”;

try{

BufferedReader br = new BufferedReader( new FileReader(file));
String strLine = “”;
StringTokenizer st = null;
int lineNumber = 2, tokenNumber = 0;
//read comma separated file line by line
while( (strLine = br.readLine()) != null)
{
lineNumber++;
//break comma separated line using “,”
st = new StringTokenizer(strLine, “,”);
while(st.hasMoreTokens())
{
//display csv values
tokenNumber++;
//System.out.println(” Token : “+ st.nextToken());
}
//reset token number

tokenNumber = 0;

}

}catch(Exception e){
System.out.println(“The ” + e);
}

//jumlah baris..
int[][] m= new int[10][10];

//pemanggilan data
for(int i=0;i<m.length;i++){
for(int j=0;j<m.length;j++){
System.out.print(” ” + st.nextToken() );
}
System.out.println();
}
}
}

//pemanggilan kelas..
class TestArray{
public static void main(String[] args){
ArrayKu3 m = new ArrayKu3();
m.buatArray();
}
}

dicoba saja ne array.. ntar keluar apa????….:D…sebelumnya saya juga binggung yang diatas apa…tolong bagi yg bisa jelasin y mbok comment…:D:D

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s