devxlogo

Tip Bank

Customizing Serialization

If a class contains non-serializable variables, and you need to preserve the state of those variables, you will have to customize the default serialization behavior of the class. You can

Watch out for the NotSerializableException

The Serializable interface is a marker interface–in other words, it contains no methods. Its purpose is to categorize the classes that may be serialized using Java’s serialization API. Only the

Accessing a C++ Object in C Code

C code, which of course is unaware of object semantics, can access the data members of a C++ object directly, but certain requirements must be met. There are some guarantees

Threading Piped Streams

Piped streams are typically used in separate threads. One thread writes output to a PipedOutputStream. The other thread reads the same data from a PipedInputStream. The two streams are connected