Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package perulangan;
- /**
- *
- * @author ivan
- */
- public class Perulangan {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- EnergiPotensial[] kerikil;
- kerikil = new EnergiPotensial[10];
- for(int i=0;i<10;i++){
- kerikil[i] = new EnergiPotensial();
- kerikil[i].setUkuran(5*i+10, 10, 2);
- }
- for(EnergiPotensial item:kerikil){
- if(item.hitungEP()>500){
- System.out.println(item.hitungEP()+ "Kerikil besar");
- }
- else{
- System.out.println(item.hitungEP()+ "Kerikil kecil");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement