-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-abstract-class.php
More file actions
35 lines (26 loc) · 861 Bytes
/
2-abstract-class.php
File metadata and controls
35 lines (26 loc) · 861 Bytes
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
<?php
echo "Copyright (C) 2021 EmptyWork\n";
abstract class ContohAbstract {
abstract public function methodPertama() :void;
abstract public function methodKedua() :void;
}
class ContohTurunanAbstract extends ContohAbstract {
public function methodPertama() :void {
echo "Method Pertama";
}
public function methodKedua() :void {
echo "Method Kedua";
}
}
# class ContohTurunanAbstractTidakLengkap extends ContohAbstract {
# public function methodPertama() :void {
# echo "Method Kedua";
# }
# }
# $contohAbstract = new ContohAbstract();
# $contohAbstract->data();
$contohClassAbstract = new ContohTurunanAbstract();
$contohClassAbstract->methodPertama();
$contohClassAbstract->methodKedua();
# $contohClassAbstractTidakLengkap = new ConthoTurunanAbstractTidakLengkap();
# $contohClassAbstractTidakLengkap->methodPertama();