Pages

Subscribe:

Ads 468x60px

♪ ♥ Get Paid Daily - The Best Sites PTC ♥ ♪
DonkeyMails.com: No Minimum Payout
AyuWage Services - Get Paid to Visits Sites and Complete Surveys

Senin, 16 Juli 2012

Contoh Program Sederhana

Contoh-contoh program sederhana:

Program ke-1
Ululalbab.java

public class Ululalbab {
  public static void main(String[] args) {
    System.out.println("Ululalbab");
  }
}
Program ke-2
Ululalbab2.java

import javax.swing.JOptionPane;
public class Ululalbab2 {
  public static void main(String[] args) {
    JOptionPane.showMessageDialog(null,"Ululalbab");
  }
}
Program ke-3
PersegiPanjang.java

public class PersegiPanjang {
int luas = 0;
  public int panjangLebar(int panjang, int lebar) {
    luas = panjang * lebar;
    return luas;
  }
}
PersegiPanjangApp.java
public class PersegiPanjangApp {
  public static void main(String[] args) {
    PersegiPanjang myPersegiPanjang = new PersegiPanjang();
    int L = myPersegiPanjang.panjangLebar(5,6);
    System.out.println("luas persegi panjang= " + L);
  }
}

0 komentar:

Posting Komentar

Please Give Your Feedback Or Message.
Thank You!!?

Unique 1:1 Traffic Exchange

♪ ♥ Ma liste de blogs ♥ ♪

♪ ♥ Please Votes! Thanks. ♪ ♥
×