array of string contains string
Bismillah
[sourcecode language="java"]if (Arrays.asList(new String[]{"satu","dua","tiga","empat"}).contains("empat")){
System.out.println("ada");
} else {
System.out.println("kosong");
}[/sourcecode]
Hasil coding di atas dijalankan adalah : ada
Alhamdulillah
No comments:
Post a Comment