-
Notifications
You must be signed in to change notification settings - Fork 0
/
Aldhiyawaris.java
97 lines (69 loc) · 1.66 KB
/
Aldhiyawaris.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* @(#)Aldhiyawaris.java
*
*
* @author
* @version 1.00 2017/8/31
*/
class pegawai
{
String nama;
int gaji;
void masuk()
{
System.out.println("Masuk kerja pukul 08:00");
}
void keluar()
{
System.out.println("Keluar kerja pukul 16:00");
}
}
class manager extends pegawai
{
void memimpin()
{
System.out.println("Memimpin departemen");
}
}
class buru extends pegawai
{
void mengangkut()
{
System.out.println("Membersihkan kantor");
}
}
public class Aldhiyawaris {
public static void main (String[] args) {
//pembuatan objek pegawai
pegawai pegawai1 = new pegawai();
pegawai1.nama = "Nama Pegawai";
pegawai1.gaji = 2500000;
System.out.println("Objek pegawai1 -->");
System.out.println("Nama = "+pegawai1.nama);
System.out.println("Gaji = "+pegawai1.gaji);
pegawai1.masuk();
pegawai1.keluar();
System.out.println("");
//pembuatan objek manager
manager manager1 = new manager();
manager1.nama = "Aldi";
manager1.gaji = 4500000;
System.out.println("Objek manager1 -->");
System.out.println("Nama = "+manager1.nama);
System.out.println("Gaji = "+manager1.gaji);
manager1.masuk();
manager1.keluar();
manager1.memimpin();
System.out.println("");
//pembuatan objek buru
buru buru1 = new buru();
buru1.nama = "Bejjo";
buru1.gaji = 1500000;
System.out.println("Objek buru1 -->");
System.out.println("Nama = "+buru1.nama);
System.out.println("Gaji = "+buru1.gaji);
buru1.masuk();
buru1.keluar();
buru1.mengangkut();
}
}