18.07.2013 Views

Pemrograman Banyak Thread - Komputasi

Pemrograman Banyak Thread - Komputasi

Pemrograman Banyak Thread - Komputasi

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

uat dan jalankan thread customer<br />

Customer customer[ ] = new<br />

Customer[NUMCUSTOMER];<br />

}<br />

for (int i = 0; i < NUMCUSTOMER; i++) {<br />

}<br />

customer[i] = new Customer(account);<br />

customer[i].start( );<br />

//menunggu thread customer selesai<br />

for (int i = 0; i < NUMCUSTOMER; i++) {<br />

}<br />

try { customer[i].join( ); }<br />

catch (InterruptedException e) { e.printStackTrace( ); }<br />

//menampilkan saldo (balance) account<br />

System.out.println(account.getBalance( ) );<br />

} 42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!