Minggu, 18 April 2010

Java parameter

class Parameter {

public static void hitung(int a, int b, int c){

c = a + b;
System.out.println("dalam prosedur : hasil penjumlahan : " + c);

}

public static void main(String[] args) {
int operan1 = 2;
int operan2 = 3;
int hasil = 0;
hitung(operan1, operan2, hasil);

System.out.println("setelah prosedur : nilai hasil : " + hasil);

}
}