Created
October 1, 2012 17:45
-
-
Save inertperson/3813274 to your computer and use it in GitHub Desktop.
Java: contoh inheritance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Nilai extends Grade{ | |
double presensi ; | |
double uts; | |
double uas; | |
double tugas; | |
public Nilai(){ | |
this.presensi = 0; | |
this.uts = 0; | |
this.uas = 0; | |
this.tugas = 0; | |
super.nilaiAkhir = 0; | |
} | |
public void setPresensi(double presensi){ | |
this.presensi=presensi; | |
} | |
public void setUts (double uts){ | |
this.uts=uts; | |
} | |
public void setUas (double uas){ | |
this.uas=uas; | |
} | |
public void setTugas (double tugas){ | |
this.tugas=tugas; | |
} | |
public void setNilaiAkhir(){ | |
double n = 0.0; | |
n = this.presensi + this.uts + this.uas + this.tugas; | |
this.nilaiAkhir = n; | |
} | |
public get | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment