-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mobil.java
59 lines (47 loc) · 1.18 KB
/
Mobil.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
/**
* @(#)Mobil.java
*
*
* @author
* @version 1.00 2017/8/10
*/
public class Mobil {
String merek;
String warna;
String type;
void maju()
{
System.out.println("Sedang Melaju");
}
void mundur()
{
System.out.println("Sedang Mundur");
}
void berhenti()
{
System.out.println("Sedang Berhenti");
}
}
class ObjectMobil
{
public static void main (String[] args)
{
Mobil mobilku = new Mobil();
mobilku.merek = "Toyota";
mobilku.warna = "Silver";
mobilku.type = "Bus";
System.out.println("***************************");
System.out.println("* SMK TELKOM *");
System.out.println("*-------------------------*");
System.out.println("* Nama : Emya Tarigan *");
System.out.println("* Kelas : XI RPL *");
System.out.println("* No.Urut : 07 *");
System.out.println("***************************");
System.out.println("Merek Mobil : "+mobilku.merek);
System.out.println("Warna Mobil : "+mobilku.warna);
System.out.println("Type Mobil : "+mobilku.type);
System.out.println("");
System.out.println("Keadaan Mobil : ");
mobilku.berhenti();
}
}