News

How to use Java generics to avoid ClassCastExceptions. Oct 10, 2024 23 mins. how-to. Exception handling in Java: Advanced features and types. Sep 19, 2024 23 mins. how-to.
Why use typesafe enums, not enumerated types. An enumerated type specifies a set of related constants as its values. Examples include the days in a week, the standard north/south/east/west compass ...
Enum Serialization and Deserialization in Java Serialization: By default, Java serializes enums using their name() method, storing the enum constant's name as a string.
Although the default constructor in Java is convenient and easy to use, developers must understand some important rules about its existence and implementation. Follow these five guidelines when you ...
The java.util.function.Consumer class has one non-default method named accept which takes a single object as its argument and has a void return type. java.util.function.Consumer<T> Consumer function ...
Java modules is another name for JPMS (Java Platform Module System), added on JDK 9 under the name Project Jigsaw. It allows applications (packaged as JAR or WAR) to define a module-info.java file on ...