Hidden Beauties of Java Enums: The Not-So-Secret Weapon That Can Do A Lot More

preview_player
Показать описание
Discover the hidden beauties of Java enums in this insightful video that delves deep into this powerful feature of the Java programming language. Java enums are often seen as simple constructs, but they are a not-so-secret weapon that can significantly enhance your coding efficiency and best practices.

Join us as we explore advanced Java techniques, providing practical enum examples, patterns, and tips that every developer should know. Whether you want to improve your software development skills or want to understand the full potential of enums, this video offers valuable insights into their usage in real-world scenarios.

Unlock the advanced capabilities of Java enums and learn how they can streamline your development process. From programming hacks to best practices, this video is a must-watch for developers looking to elevate their Java knowledge. Don't miss out on these essential concepts that can transform your approach to Java programming!

Watch now to uncover the secrets of Java enums and take your development skills to the next level!

NOTE: there is actually an error in one of the code examples, just to check if someone notices ;-)
Around 12'-13' the code "class Customer() {" should not have the "()".

The blog post is available here:

And the sources here:

Other links mentioned:
Рекомендации по теме
Комментарии
Автор

Indeed some nice things to do with enums, and that customer state is indeed quite an apt example. And the code error was indeed spotted at the 12:04 mark. Thank you for the interesting video and blog post.

VerhoevenSimon
Автор

Wonderful video Frank. Learned a new thing in Java. Please also make videos on JavaFX tutorials. There are very few JavaFX tutorials online. Please keep posting videos regularly.

TheKundan
Автор

I came from reddit ! Nice content I want to be good programmer like you one day !! I have 5 years of exp and it feels like I know nothing

Manuel-oegv
Автор

A few notes:
- your project directory has an .idea directory but you open it with vscode. You don't want to show people your IntelliJ? :)
- you're using java 17, aren't you? If yes, your switch (...) { case ...: return 1; ... } doesn't look very nice as there are a lot of return's in there.
- you use jband EnumExtended.java instead of java EnumExtendec.java. What's the advantage of using jbang over java?

avalagum
Автор

I guess the only new thing I discovered here is JBang :)

duta.
Автор

Hey great overview of enum functionality, you could also show that an enum is basically a immutable class and can also implement interfaces, this could potentiality lead to interesting use cases like an light version of strategy pattern, also quick question, why you are doing Arrays.stream().sequential() is'n it sequential by default ? Other then this great video you got one more subscriber :D

Misa
Автор

I fail to see any benefit of enums over: final String[] values = { "X1", "X2", ..., "Xn" };

donwinston
Автор

1. "Enum members are instances of the enum type" ehm, yeah. Surprise. It is the case since forever. It is not hidden, always been there. "Enum type much like any class can have fields and methods, including constructors". Yeah, nothing new really, nothing hidden either!
2. Also, cringe using java instead of normal javac->java sequence. You are targeting pupils, students, newbies! Don't teach them bad!

yaroslavpanych