Localization, Internalization, Serialization, Reflection and Garbage Collection Flashcards
What is Locale in Java?
A Locale object represents a specific geographical, political, or cultural region. It is used to locale-sensitive operations in Java.
It helps in following the local conventions of a country, native or region. These conventions can be for formatting the dates, money,
numbers etc.
How will you use a specific Locale in Java?
To use a specific Locale, we need to load that Locale. We can use ResourceBundle.getBundle(“Locale.UK”) method to load a Locale.
What is the serialization?
Serialization is a process converting an object into a byte array. This byte array represents the class, version and internal state of the
object. JVM can use this byte array to transmit/read the object over
a network.
What is the purpose of serialization?
- Communication: It is used for transmitting an object over network between two machines.
- Persistence: We can store the object’s state in a database and retrieve it from database later on.
- Caching: Serialization can be used for caching to improve performance. We may need 10 minutes to build an object, but it may take just 10 seconds to de-serialize the object.
- Cross JVM Synchronization: It can be used in same way across multiple JVM that follow different architecture.