How To Serialize and Deserialize Enums
In this tutorial, we will see serialization and deserialization of Enums and sample java codes. Enums Serialization: Java’s Serializable interface handles serialization of enums in a special way. Enum types…
In this tutorial, we will see serialization and deserialization of Enums and sample java codes. Enums Serialization: Java’s Serializable interface handles serialization of enums in a special way. Enum types…
ExecutorService and CompletionService are both interfaces in the Java concurrency framework that provide a way to execute tasks asynchronously in a multithreaded environment. However, they serve different purposes. ExecutorService provides…
What is the Java Executor Framework? The Java Executor Framework is a set of interfaces and classes in Java that simplify the task of writing concurrent code. It provides a…
Iterator and ListIterator are interfaces in Java that allow us to iterate over a collection of objects. However, there are some differences between them: The Iterator interface can be used…
In Java, both HashMap and TreeMap are used for key-value pair storage. However, there are some differences between them: Ordering: HashMap does not maintain any order for the elements, while…
In this post, we will learn various ways of converting input stream to String In this example, we will see that InputStream will be converted to String using java8 streams…
In this post, we will see questions asked on String during java interview 1. Explain String pool in java? String Pool is java string literals pool that JVM maintains a…
Circular references during serialization in Java can cause StackOverflowError or OutOfMemoryError exceptions. This happens because a circular reference creates a loop in the object graph that the serialization process tries…
In Java, serialization of inner classes can be a bit tricky due to the relationship between inner classes and their enclosing classes. Static inner classes are serializable just like any…
In Java, serialization works with inheritance in the following way: If a class implements Serializable, its subclasses will also be serializable, regardless of whether the subclasses implement Serializable or not.…