Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritance #224

Closed
Tracked by #219
reacto11mecha opened this issue Nov 23, 2021 · 0 comments · Fixed by #233
Closed
Tracked by #219

Inheritance #224

reacto11mecha opened this issue Nov 23, 2021 · 0 comments · Fixed by #233
Assignees
Labels

Comments

@reacto11mecha
Copy link
Member

reacto11mecha commented Nov 23, 2021

Materi ini berisi tentang bagaimana sebuah class bisa digunakan untuk mewarisi sifat class yang memiliki sifat yang sama seperti class yang diwarisi. Sama halnya manusia dalam mewarisi sifat genetik dari orang tua ke anak-anaknya.

Buatlah class dasar yang memiliki sifat dasar yang bisa di warisi ke anakan class, misalnya HewanKakiEmpat. Satu saja dengan method bawaan, semisal berjalan, makan, tidur, dll.
Untuk class anakan bisa inherit dari class parent yang sudah dibuat, contoh Kucing, Kuda, Anjing yang sama sama memiliki kesamaan sifat. Minimal terdapat 2 class anakan yang inherit ke class parent.

Folder: /learn/OOP/005_Inheritance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants