Skip to content

Commit f807021

Browse files
committed
Buat: versi abstract
1 parent 15549cf commit f807021

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

2-abstract-class.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
abstract class ContohAbstract {
4+
abstract public function data() :void;
5+
}
6+
7+
class ContohTurunanAbstract extends ContohAbstract {
8+
public function data() :void {
9+
echo "Hello";
10+
}
11+
}
12+
13+
# $contohAbstract = new ContohAbstract();
14+
# $contohAbstract->data();
15+
16+
$contohClassAbstract = new ContohTurunanAbstract();
17+
$contohClassAbstract->data();

0 commit comments

Comments
 (0)