Pattern Matching in Java by Venkat Subramaniam

แชร์
ฝัง

ความคิดเห็น • 4

  • @RickGladwin
    @RickGladwin 8 หลายเดือนก่อน +3

    I’m a simple man. I see a Venkat Subramaniam video, I click it.

  • @machindrakarpe7498
    @machindrakarpe7498 8 หลายเดือนก่อน +1

    I admire you a lot, always excited for your new videos

  • @RickGladwin
    @RickGladwin 8 หลายเดือนก่อน

    Around 52:40, the use of `sealed` without `permits` is really clean, but how/when does the compiler determine that `Sell` and `Buy` are the only two entities implementing `Trade`? Or if the compiler keeps track of everything that implements `Trade` whether `Trade` is sealed or not, does the `sealed` modifier just tell it to treat that set as complete, for the purposes of things like pattern matching?

    • @0equalsTo1
      @0equalsTo1 5 หลายเดือนก่อน

      If we define permitted subclasses in the same file as the sealed interface | class, then we can omit permits clause.