-setelah user memasukkan inputan :
1-program me-Looping utk mncari input yg dimasukkan user itu index ke berapa.
2-setelah di ketahui "input" index ke (x) maka index tersebut di simpan dlm suatu variable.
3-membuat array baru yg panjangnya sama dengan panjang array lama -1.
4-mengisi data array baru dg data array lama:
a.program me-Looping mencari index yg lebih kecil dari index ke (x) dg cara di cara di bandingkan, kemudian jika ada index yang lebih kecil dari index ke (x) maka data index tersebut di tambahkan ke dalam array baru.
b.program me-Looping mencari index yg lebih besar dari index ke (x) dengan cara di cara di bandingkan, kemudian jika ada index yang lebih besar dari index ke (x) maka data index tersebut di tambahkan ke dalam array baru
berikut adalah suatu method fungsi yg berguna utk menghapus item(index)
public class deleteItem {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] data = { "a", "b", "c" };
String delete = "b";
String[] newData = new String[data.length - 1];
int index = 0;
for (int c = 0; c < data.length; c++) {
if (data[c].equals(delete)) {
index = c;
break;
}
}
// looping di atas berfungsi untuk mencari tahu item yg mau di hapus berada di index ke berapa.
for (int x = 0; x < index; x++) {
newData[x] = data[x];
}
// utk mengisi array baru dg index yg lebih kecil dari input
for (int y = index + 1; y < data.length; y++) {
newData[y - 1] = data[y];
}
// utk mengisi array baru dg index yg lebih besar dari input
for (int z = 0; z < newData.length; z++) {
System.out.println(newData[z]);
}
}
}
//============//
output
a
c
Sabtu, 09 Juni 2012
Chord Warmness on the soul A7x
Em C G D Em
Your hazel green tint eyes watching every move I make.
C G D
And that feeling of doubt, it's erased.
Em C G D Em
I'll never feel alone again with you by my side.
C G D
You're the one, and in you I confide.
Em C G D Em
And we have gone through good and bad times.
C G D Em
But your unconditional love was always on my mind.
C G D
You've been there from the start for me.
Em C G D
And your loves always been true as can be.
C D Em
I give my heart to you.
C D G Em D C D
I gave my heart, cause nothing can compare in this world to you. Woaho
Em C G D Em
And we have gone through good and bad times.
C G D Em
But your unconditional love was always on my mind.
C G D
You've been there from the start for me.
Em C G D
And your loves always been true as can be.
C D Em
I give my heart to you.
C D G Em D C
I gave my heart, cause nothing can compare in this world to you.
#Slow sbentar..,
Your hazel green tint eyes watching every move I make.
C G D
And that feeling of doubt, it's erased.
Em C G D Em
I'll never feel alone again with you by my side.
C G D
You're the one, and in you I confide.
Em C G D Em
And we have gone through good and bad times.
C G D Em
But your unconditional love was always on my mind.
C G D
You've been there from the start for me.
Em C G D
And your loves always been true as can be.
C D Em
I give my heart to you.
C D G Em D C D
I gave my heart, cause nothing can compare in this world to you. Woaho
Em C G D Em
And we have gone through good and bad times.
C G D Em
But your unconditional love was always on my mind.
C G D
You've been there from the start for me.
Em C G D
And your loves always been true as can be.
C D Em
I give my heart to you.
C D G Em D C
I gave my heart, cause nothing can compare in this world to you.
#Slow sbentar..,
Langganan:
Postingan (Atom)
Chord The Day's Of Father-Superman Is Dead
Intro: G5 . . . . E5 4x E5 B5 E5 B5 A5 B5 C5 D5 E5 E5 B5 E5 B5 A5 B5 C5 E5 B5 E5 B5 A5 B5 C5 D5 E5 2x E5 When the morning comes to spot...
-
Kali ini aku mau sharing tentang cara memanipulasi data di Array :D. Jadi Array adalah sekelompok variabel yang memiliki nama sama. Setiap ...
-
-setelah user memasukkan inputan : 1-program me-Looping utk mncari input yg dimasukkan user itu index ke berapa. 2-setelah di ketahui "...