selamat hari raya!
/*
SelamatHariRaya.java
Author: Hazrul Azhar
Description: This program wishes you Selamat Hari Raya, and Maaf Zahir Batin. It resets dosa counter to zero if forgiven, and forces the counter to zero if not.
*/
public class SelamatHariRaya {
Person Haz=new Person();
Person You=new Person();
public static void main(String args[]) {
this.ucapan();
this.minta_maaf();
}
public void ucapan() {
System.out.println("Selamat Hari Raya!");
}
public void minta_maaf() {
System.out.println("Maaf Zahir Batin");
if(You.forgive()) {
// If you forgive, reset dosa counter to 0;
Haz.dosa_kat_you=0;
} else {
// Else if you don't forgive, still reset counter to 0;
Haz.dosa_kat_you=0;
}
}
}



tak leh compile la, beb.
“Error: non-static variable this cannot be referenced from a static context”
hehe.
selamat hari raya
hahaha.
mmg tak leh compile lah. Kau nak kena bikin to Person class dulu. Bih declare dosa_kat_you integer variable and implement a method forgive() which returns a boolean value.
K? k. heee.