package jumat;
public class staaaaaaaff {
private String nip,nama,golongan;
private int gaji;
public String getNip(){
return nip;
}
public void setnip(String nip) {
this.nip = nip;
}
public String getNnama(){
return nama;
}
public void setnama(String nama) {
this.nama = nip;
}
public String getGolongan(){
return golongan;
}
public void setgolongan(String golongan) {
this.golongan = golongan;
}
public int getGaji(){
return gaji;
}
public void setgaji(int gaji) {
this.gaji = gaji;
}
}
package jumat;
public class doseeen {
private String nip,nama,golongan;
private int gaji;
public String getNip(){
return nip;
}
public void setnip(String nip) {
this.nip = nip;
}
public String getNnama(){
return nama;
}
public void setnama(String nama) {
this.nama = nama;
}
public String getGolongan(){
return golongan;
}
public void setgolongan(String golongan) {
this.golongan = golongan;
}
public int getGaji(){
return gaji;
}
public void setgaji(int gaji) {
this.gaji = gaji;
}
}
package jumat;
public class employee {
private String nama,nip,golongan;
private int gaji;
public void employ(String nama1)
{
this.nama=nama1;
}
public void setNip(String nip1)
{
this.nip=nip1;
}
public void setGolongan(String golongan1, int gaji1)
{
this.golongan=golongan1;
this.gaji=gaji1;
}
public void get()
{
System.out.println(nama);
System.out.println(nip);
System.out.println(golongan);
System.out.println(gaji);
}
}
class staaaaaff extends employee
{
static staaaaaff objek2;
public void staaaaaff()
{
String jabatan=javax.swing.JOptionPane.showInputDialog("Staff
Bagian :");
System.out.println("Staff bagian : "+jabatan);
}
}
class dosen extends employee
{
private static class objek2 {
private static void staff() {
}
private static void get() {
}
public objek2() {
}
}
private static class staaaaaff {
private static staaaaaff objek2;
public staaaaaff() {
}
}
public void DOSEN()
{
String nama=javax.swing.JOptionPane.showInputDialog("Nama dosen
:");
System.out.println("Nama dosen : "+nama);
}
public static void main(String[] args) {
dosen objek=new dosen();
objek.DOSEN();
objek.employ("afifuddin");
objek.setNip("131051076");
objek.setGolongan("golongan", 1000000000);
objek.get();
staaaaaff.objek2=new staaaaaff();
objek2.staff();
objek2.get();
}
}
Belum ada tanggapan untuk "pemrograman berbasis objek 2"
Post a Comment