Membuat Program Java Sederahana


Buka Netbean Anda, kemudian ketikkan script seperti di bawah ini:

public class persegiPanjang

{

       public static void main(String[] args)

       {

          int luas, lebar, keliling;

          luas = 20;

          lebar = 45;

          keliling = 2 * (luas + lebar);

          System.out.println("Hasil Keliling: "+ keliling);

       }

}

Kemudian click Run.

Selamat mencoba!!

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