selamat hari raya!

012th Oct 2007My Notes

/*
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;
}
}
}

No Comments Comments Feed

  1. hirman (October 12, 2007, 7:10 pm).

    tak leh compile la, beb.

    “Error: non-static variable this cannot be referenced from a static context”

    hehe.

    selamat hari raya :)

  2. abanghazrul (October 12, 2007, 9:52 pm).

    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.

Add a Comment

You must be logged in to post a comment.