Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. abstract class People {
  2.  
  3. abstract fun think()//all people think different
  4. abstract fun dream()//all people have different dreams
  5.  
  6. fun breathe() {
  7. //make this people breathe, all people breathes
  8. }
  9.  
  10. fun eat() {
  11. //make this people eat, all people eats
  12. }
  13.  
  14. fun getOlder(){
  15. //make this people get older, all people get older
  16. }
  17. }
  18.  
  19. class Doctor : People(){
  20. override fun think() {
  21. //implement what this specific thype of people thinks (it thinks as a doctor)
  22. }
  23.  
  24. override fun dream() {
  25. //implement what this specific thype of people dreams (it dreams as a doctor)
  26. }
  27.  
  28. fun doDoctorStuff()
  29. {
  30. //implement how this doctor does his stuff, this is specific to doctors
  31. }
  32. }
  33.  
  34. //============ testing ===============
  35.  
  36. val doctor = Doctor()
  37. doctor.breathe()
  38. doctor.getOlder()
  39. doctor.eat()
  40. doctor.think()
  41. doctor.dream()
  42. doctor.doDoctorStuff()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement