Exception in thread “main” java.lang.NullPointerException:
Cannot invoke “String.toLowerCase()” because the return value of
“com.baeldung.java14.npe.HelpfulNullPointerException$PersonalDetails.getEmailAddress()” is null
at com.baeldung.java14.npe.HelpfulNullPointerException.main(HelpfulNullPointerException.java:10)
Exception in thread "main" java.lang.NullPointerException:
Cannot invoke "String.toLowerCase()" because the return value of
"com.baeldung.java14.npe.HelpfulNullPointerException$PersonalDetails.getEmailAddress()"isnull
at com.baeldung.java14.npe.HelpfulNullPointerException.main(HelpfulNullPointerException.java:10)
I haven’t written any Java since Java 6. This makes me so happy to hear.
What about XML, and XML based configs? Is the Java ecosystem still obsessed with XML?
I remember I was once trying to learn Hibernate. After finding what I thought looked like the best tutorial, I skimmed through it and there was literally no Java code in the tutorial about a Java library! It was all XML! I never could understand it, but this was early in my career, maybe I could handle it now, maybe not.
Nah, Hibernate, Spring and most major Java frameworks have largely moved away from XML. It’s still supported, but these days it’s mostly configured in the code directly, with properties loaded from yaml, JSON or the environment (for containers).
The JDK ecosystem is in a pretty good spot nowadays. With Spring boot you can whip up a productions ready back-end very fast, or if you prefer a more hands-on approach there are lighter frameworks/libraries quarkus or micronaut.
The Java language itself has evolved fast and is actually pretty nice now, and if you prefer something more modern akin to TS or swift you can just use Kotlin which is almost 100% interoperable with Java.
Holy shit in so glad it’s not just me. All I have ever seen from Java seems to be NullPointerException.
(Which makes sense, but still, it’s pretty funny)
Java:
NullPointerException
Since Java 14 it looks like this:
Formatted, so I can read it
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.toLowerCase()" because the return value of "com.baeldung.java14.npe.HelpfulNullPointerException$PersonalDetails.getEmailAddress()" is null at com.baeldung.java14.npe.HelpfulNullPointerException.main(HelpfulNullPointerException.java:10)
I haven’t written any Java since Java 6. This makes me so happy to hear.
What about XML, and XML based configs? Is the Java ecosystem still obsessed with XML?
I remember I was once trying to learn Hibernate. After finding what I thought looked like the best tutorial, I skimmed through it and there was literally no Java code in the tutorial about a Java library! It was all XML! I never could understand it, but this was early in my career, maybe I could handle it now, maybe not.
Nah, Hibernate, Spring and most major Java frameworks have largely moved away from XML. It’s still supported, but these days it’s mostly configured in the code directly, with properties loaded from yaml, JSON or the environment (for containers).
The JDK ecosystem is in a pretty good spot nowadays. With Spring boot you can whip up a productions ready back-end very fast, or if you prefer a more hands-on approach there are lighter frameworks/libraries quarkus or micronaut.
The Java language itself has evolved fast and is actually pretty nice now, and if you prefer something more modern akin to TS or swift you can just use Kotlin which is almost 100% interoperable with Java.
And the entire stack trace
And a description saying which variable in which object was accessed. Could be better, could be worse 🤷
with the most recent call last, but the actual exception at the top
Holy shit in so glad it’s not just me. All I have ever seen from Java seems to be NullPointerException. (Which makes sense, but still, it’s pretty funny)