New Java 23 Preview feature - Flexible constructor bodies!

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • Join this channel to get access to perks:
    / @java.brains

КОМЕНТАРІ • 34

  • @pat.310
    @pat.310 2 дні тому +7

    I have been following you since the year when I joined and started working as a developer, 15 years ago, you are one of the finest teachers I have ever met. I should really appreciate you as you played an important role in setting up my many fundamental concepts about Java. Thank you.

    • @TheStoicPlayer64
      @TheStoicPlayer64 День тому

      Hey @pat.310 I would like to know if you can refer to me at your workplace for a Java developer role if there is open position right now? I have 4 years of experience.

    • @budi22
      @budi22 День тому

      @@TheStoicPlayer64 :D

    • @TheStoicPlayer64
      @TheStoicPlayer64 День тому

      @@budi22 hello 👋

  • @ShivaKumarSatakuri
    @ShivaKumarSatakuri 2 дні тому +26

    Looks like java isn't gonna die anytime soon. And I'm very happy about it 😊

    • @tejumania
      @tejumania День тому +2

      It's going no where

    • @gurdeeps
      @gurdeeps День тому +2

      Java is on thin ice at the moment. With the arrival of containers almost every code is now write once run anywhere. Only thing going for Java is the large developer base.

    • @sanjaysreedhar9162
      @sanjaysreedhar9162 День тому

      But pretty difficult to keep catching up with newer features every single year

  • @akaappleboy
    @akaappleboy 2 дні тому +4

    Thank you for constantly updating us with the new booms of java ! Really appreciate it.

  • @sudiptamaity1320
    @sudiptamaity1320 2 дні тому +2

    Nicely explained 😊

  • @DJpiya1
    @DJpiya1 День тому +3

    It took 28 freaking years for them to realize that this must have been supported from the version 1.1 😂😂

  • @MAYANKKUMAR-iw5qp
    @MAYANKKUMAR-iw5qp 2 дні тому +1

    Finally! hope it comes with stable version.

    • @Java.Brains
      @Java.Brains  2 дні тому

      Yup! I’m almost certain this one is coming!

  • @Smegmachin
    @Smegmachin День тому

    Superb!

  • @adarshverma3372
    @adarshverma3372 День тому

    Where is your java23 video which you had made, I can't find anywhere on youtube.

  • @Tony-dp1rl
    @Tony-dp1rl День тому +1

    async/await support? dynamic optimal hardware thread use like C# or Golang? Fixes to the terrible package manager? Faster web server? Better lightweight containers? Better native dependency injection? ... better ... some tweaks to Constructors. LOL. Who runs this show, and why do they hate Java developers so much?

  • @javaremastered1530
    @javaremastered1530 2 дні тому

    i am subscribed from last 10 years not even once i get your update in youtube subscription box yt is wants people to watch dance n controversial things but not education thats why less video on education.. we should have edu platform differently..

    • @Java.Brains
      @Java.Brains  День тому +1

      UA-cam only cares that you are hooked and watching videos. This is why I encourage people to click the bell icon for educational channels, and not entertainment ones.

  • @roronoa_d_law1075
    @roronoa_d_law1075 2 дні тому

    What's wrong with calling super before doing validation ?

    • @Java.Brains
      @Java.Brains  2 дні тому +3

      If the initialization of the super class is expensive, you want it to happen after the validation check. There’s no point in creating an instance if you’re gonna throw an exception in the constructor anyway.

    • @dhronanpandarinathan
      @dhronanpandarinathan 2 дні тому +2

      When you know the value is invalid and calling super is unnecessary, why would you call super?

    • @roronoa_d_law1075
      @roronoa_d_law1075 2 дні тому

      Ok thanks 👍

    • @Mr.rawJat
      @Mr.rawJat 2 дні тому +1

      Validation is done before calling the constructor. Why would someone validate in the constructor?

  • @minor12828
    @minor12828 День тому

    It is super no pun intended 😅

  • @lts8683
    @lts8683 2 дні тому

    This is a preview not a stable feature, I don't know why the people explain preview features that could be removed on the next lts java.

    • @Java.Brains
      @Java.Brains  2 дні тому +10

      It’s because the purpose of the preview is to share new features with the community and evaluate the response. As a member of the Java community, I’d rather we learn about this than not

    • @Mr.rawJat
      @Mr.rawJat 2 дні тому

      Where are those responses posted? Which are used for evaluation?

  • @Flw383
    @Flw383 2 дні тому

    I see no point in this feature. If you want to validate that field, then do the validation in the superclass constructor instead of the subclass.

    • @Java.Brains
      @Java.Brains  2 дні тому +3

      You are assuming the validation is the superclass’ concern. What if the validation applies only to the child class? If multiple child classes each required their own validation while the parent class doesn’t care?

    • @Flw383
      @Flw383 День тому

      ​@@Java.Brains If multiple child classes require their own validation of a property owned by the parent class, it might be a sign that a redesign is needed. If it's still necessary for each child class to perform its own validation, then using a template method could be a good solution. In many cases, inheritance leads to a rigid design, where child classes end up taking on responsibilities that don't belong to them. If child classes are responsible for validating attributes of the base class, it undermines the principle that the superclass should manage its own state. This could indicate a poor distribution of responsibilities and a violation of fundamental software design principles.

  • @DineshPatel-fp6wl
    @DineshPatel-fp6wl День тому

    Java past its Sell By Date