This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Contoh koding prosedural | |
$a = 20; | |
$b = 20; | |
$hasil = $a+$b; | |
echo "Hasil : ".$hasil; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.enkapsulasi; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
public class KipasAngin { | |
//Atribut |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.abstraksi; | |
import java.util.Calendar; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
abstract class Manusia { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.pewarisan; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
abstract class Manusia { | |
private String nama; | |
private String jenisKelamin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.polimorfisme; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
abstract class BangunDatar { | |
abstract double hitungKeliling(); | |
abstract double hitungLuas(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.solid; | |
import java.text.NumberFormat; | |
import java.util.ArrayList; | |
import java.util.Locale; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.solidprinciple; | |
import java.text.NumberFormat; | |
import java.util.ArrayList; | |
import java.util.Locale; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.solidprinciple; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
//Contoh yang tidak menggunakan | |
//Open/Closed Principle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.solidprinciple; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
class AlatMusik { | |
public void berbunyi(){ | |
System.out.println("Bunyi alat musik..."); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package galihlprakoso.com.solidprinciple; | |
/** | |
* | |
* @author galihlarasprakoso | |
*/ | |
//Implementasi yang tidak memenuhi prinsip | |
interface InteraksiPenggunaDenganLayar { | |
void menekan(); |
OlderNewer