Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class LebronJames impliments Human{
  2. public firstName: string = "Lebron"
  3. public lastName: string = "James"
  4. public occupation: string = "All-Time Great NBA Player"
  5. // notice below this field wasn't mention in the human interface
  6. private numOfChampionships: number = 3
  7.  
  8. greet = (name: string): string => {
  9. return`Hey ${this.firstname} ${this.lastName}, nice to meet you.`
  10. }
  11.  
  12. walk = (): string => {
  13. return "I'm going to have a nice walk near Staples Center with my 3 rings"
  14. }
  15.  
  16. introduce = (): string => {
  17. return `my name is ${this.firstName} ${this.lastName}, i play for the Lakers`
  18. }
  19. // notice how this method also wasn't listed in the interface
  20. bragAboutRings = (): string => {
  21. return `yeah i got like ${this.numOfChampionships} rings or whatever, not a big deal`
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement