TypeScript Basics 14 - Inheritance and Polymorphism In TypeScript

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024
  • Access the full course here: javabrains.io/...
    In this lesson, we'll learn how inheritance and polymorphism work in TypeScript. Create multiple classes that extend the same base class and use polymorphism to access those instances.
    Course: TypeScript Basics
    Learn about the basics of TypeScript. Understand how types work, how to use arrays and tuples, how to declare classes and interfaces. Understand concepts of type erasure, duck typing, enums, generics and modules. Create a development workflow and configure the TypeScript compiler to your needs. And watch as I build an end-to-end TypeScript application from scratch.

Комментарии • 21

  • @alexop5919
    @alexop5919 2 года назад +1

    So much similarity with Java, such a relief.

  • @rahulagarwalvlogging
    @rahulagarwalvlogging 6 лет назад +1

    Hi Koushik,
    Thanks for all the great courses. I feel much confident after going through your tutorials. I have a query w.r.t. this tutorial and would really appreciate your response. I did inheritance in typescript as in this video and then went on to check the corresponding transpiled JS code for that. I found to my surprise that the inheritance done in JS code is much different than what I understood from your JavaScript inheritance tutorial where childClass.prototype.__proto__ = parentClass.prototype was sufficient to create inheritance chain. I would be extremely grateful to you if you help us with a connect between the two logic. Always a great admirer of you :)
    Best,
    Rahul

  • @vahidsaebi5653
    @vahidsaebi5653 5 лет назад +1

    Hi Koushik, ty , your videos so helpful

  • @hyperborean72
    @hyperborean72 4 года назад

    How nice to find the same concepts here as in Java

  • @pablokatt
    @pablokatt 5 лет назад +1

    Such amazing content!! Thanks so much!!

  • @iosaroj
    @iosaroj 4 года назад +1

    In the polymorphism example, are we typecasting aProgrammer object to be of type Person instead of Programmer ?

  • @TheYmBProduction
    @TheYmBProduction 4 года назад

    GOOD JOB!!!!

  • @mendarkbabu
    @mendarkbabu 6 лет назад +1

    in C# or any c language if base class is holding instance of derived class, when we make a call for same method name it would execute from base class method. i think its different in typescript

    • @avinashdudala9490
      @avinashdudala9490 5 лет назад

      Same doubt... Parent class method should be called. Instead child class.

  • @GrayCo
    @GrayCo 5 лет назад

    Great TypeScript videos. Thank you for your impressive efforts. If you don't mind a question, what are your settings.json for ("terminal.integrated.shell.windows":) ?

  • @husniddinqurbonboyev2634
    @husniddinqurbonboyev2634 5 лет назад +1

    JavaScript also has class data sturcture

    • @HaraldEngels
      @HaraldEngels 5 лет назад

      Correct, since 2015. It made a huge difference for JS.

  • @kaykostadinov9030
    @kaykostadinov9030 4 года назад +2

    "Programmers are people after all"
    You're not fooling anyone bro

  • @TheRohitGosain
    @TheRohitGosain 5 лет назад +1

    Hello World! Koushik.

  • @rohitsharma-xt8qe
    @rohitsharma-xt8qe 2 года назад

    1:25 When you side programmers are people after all. 😅😅

  • @cristianscript5649
    @cristianscript5649 6 лет назад

    you have to use a constructor always

  • @codehan
    @codehan 3 года назад

    Don’t use var, use let or const :)

  • @adriatic123
    @adriatic123 3 года назад

    There IS inheritance in javascript, and way more elegant than typescript or other OOP type inheritance. it is so simple that people think it is wrong to use it. Why? The funny thing is people think that TS is a strongly typed language, thus more reliable than loosely typed JS. They forget that every typescript at the end must be transpiled into javascript, which simply ignores types. Funny how programmers love to make their life harder.