RSS

Nilai Random dalam jangkauan tertentu di J2ME

29 Mei

Untuk membuat suatu bilangan random dalam suatu jangkauan tertentu
khususnya di J2ME, cobalah perintah dibawah ini:
misalkan bilangan random yang diinginkan: 0 s/d 2


int batasatas = 2;
int batasbawah = 0;
Random r = new Random();
int hasil = (r.nextInt() >>> 1) % (batasatas +1 – batasbawah) + batasbawah;

 
2 Komentar

Ditulis oleh pada 29 Mei 2011 in CentOS

 

Tag:

2 responses to “Nilai Random dalam jangkauan tertentu di J2ME

  1. bubbleshooter2.info

    20 Maret 2012 at 8:22 AM

    Hello,I like to read more about this topic. Thank you for writing Nilai Random dalam jangkauan tertentu di J2ME Dunia Open Source Linux.

     
  2. Mario

    25 Maret 2012 at 10:29 PM

    I think that you must write extra on this subject Nilai Random dalam jangkauan tertentu di J2ME Gerakan Open Source. It might not be a taboo topic however typically people are not enough to talk on such topics.

     

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: