Code on GitHub: github.com/lspil/youtubechannel/tree/master/welcome-java15
@raghuvardhansaripalli96364 жыл бұрын
nice video and its a touch up for java 15 new features. Thank you ..god bless you..
@javacoder19864 жыл бұрын
Thank you for posting this informative video.
@s1mpl3_4 жыл бұрын
7:47 even darker joke for the current situation would have been if you called the class Bat instead of Cat
@laurspilca4 жыл бұрын
:))
@ahadporkar73554 жыл бұрын
Thank you
@xs2farooq4 жыл бұрын
What are the practical examples / design patterns of local interfaces and local enums?
@laurspilca4 жыл бұрын
Good question, Muh. I honestly don't know where and if we'd ever use this. But it's possible this implementation is done as a prerequisite for some new features which will be implemented in next Java versions.
@BinSlayer14 жыл бұрын
Hi Laurentiu. I was wondering what your opinion was about sealed classes. I guess to me they look like they have more security, but they seem to completely break DIP and low coupling principles, don't they? Unless I'm missing something I don't see how they can be used in professional coding. I would say they are on the same level as the instanceof operator.
@laurspilca4 жыл бұрын
Now they also look like a little bit overengineering to me. But I don't want to make the mistake to say they're not useful yet, or that they might not become a successful feature. Let's see how they'll be embraced in the future by the community. It's hard to say something about a feature you have no experience with. We have to wait for a little and see if it finds a place in the ecosystem.
@vadympylypchenko58014 жыл бұрын
In my opinion, the Sealed classes and interfaces can make a big mess in the real project.
@sharifyy4 жыл бұрын
Thanks for the video. Doesn't non-sealed keyword violate the whole purpose of sealing a class?
@jakobkmar4 жыл бұрын
Only classes with permission can use non-sealed when inheriting from sealed classes. This way sealed classes can allow implementation for just the classes with permission - now these classes are normal (non-sealed) after having implemented the original sealed class.
@laurspilca4 жыл бұрын
@@jakobkmar I think Mohamad means (correct me if I'm wrong) if B extends A and A is sealed, if I make B non-sealed it could be extended by C, but this way C is also an A. So you can write A a = new C() even if A is sealed for B. That's actually an interesting question. I'd like you leave me more time to see how will these new sealed classes evolve before coming with a good answer. Or, in more decent words: I don't know how to answer yet :))
@jakobkmar4 жыл бұрын
@@laurspilca Well B still needs the permission from A. So the developer who writes class A has to think about which classes to give the permission to.
@sharifyy4 жыл бұрын
@@laurspilca yes! exactly I mean that.
@jakobkmar4 жыл бұрын
@@laurspilca Wanted to add: You said "you can write A a = new C() even if A is sealed for B" which is wrong, because (sry for writing this the third time) B needs to be listed at the "permits" list in A (and then A is NOT sealed for B). If this is not the case, then "A a = new C()" (actually it fails earlier at B extends A) would not work - so this "problem" does not exist :)
@cinzacaful4 жыл бұрын
Wow...nice video! I am learning C# and C# had "sealed" classes and I am happy to see this in Java. Can we use the generic data structures with the primitive datatypes instead of the generic classes? ex: ArrayList list = new ArrayLis();
@laurspilca4 жыл бұрын
In java you cannot use primitives for generic types. At least not yet. But I know some projects already work for this so we might have this possible in future releases.
@cinzacaful4 жыл бұрын
@@laurspilca Thanks for the answer! 🥳
@_dallas_4 жыл бұрын
the intro just made it sound like the video has ended, i got so confused...
@saikrishnakaushik28694 жыл бұрын
lmao
@rey62534 жыл бұрын
Oh fck, the sealed classes are horrible on the way how they are implemented. Why would u have to explicitly permit every class to extend it ?! In c# it is much better implemented.
@lowercaseguy35784 жыл бұрын
pls fix ur audio , the beginning raped my ear!
@laurspilca4 жыл бұрын
Hey. Sorry for this. I'll check out what's happening.