tugas java

cara membuat program java (contoh yang telah saya buat) :

  • install program java terlebih dahulu
  • buka notepad lalu ketik:

public class programRizqia {

public static void main (String [] args) {

for (int x= 1; x<= 50; x+= 2) {

System.out.println (x) ;

}

}

}

  • save dimana saja (saya menyimpan di Data (D:) )
  • save dengan nama programRizqia.java → save
  • lalu buka command prompt, ketik : javac programRizqia.java

lalu ketik : java programRizqia

 

  • jika terjadi kesalahan, maka akan muncul → errors
  • jika tidak, program berhasil.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s