Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class People {
- abstract fun think()//all people think different
- abstract fun dream()//all people have different dreams
- fun breathe() {
- //make this people breathe, all people breathes
- }
- fun eat() {
- //make this people eat, all people eats
- }
- fun getOlder(){
- //make this people get older, all people get older
- }
- }
- class Doctor : People(){
- override fun think() {
- //implement what this specific thype of people thinks (it thinks as a doctor)
- }
- override fun dream() {
- //implement what this specific thype of people dreams (it dreams as a doctor)
- }
- fun doDoctorStuff()
- {
- //implement how this doctor does his stuff, this is specific to doctors
- }
- }
- //============ testing ===============
- val doctor = Doctor()
- doctor.breathe()
- doctor.getOlder()
- doctor.eat()
- doctor.think()
- doctor.dream()
- doctor.doDoctorStuff()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement