Localization, Internalization, Serialization, Reflection and Garbage Collection Flashcards

1
Q

What is Locale in Java?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How will you use a specific Locale in Java?

A

To use a specific Locale, we need to load that Locale. We can use ResourceBundle.getBundle(“Locale.UK”) method to load a Locale.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the serialization?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of serialization?

A
  1. Communication: It is used for transmitting an object over network between two machines.
  2. Persistence: We can store the object’s state in a database and retrieve it from database later on.
  3. 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.
  4. Cross JVM Synchronization: It can be used in same way across multiple JVM that follow different architecture.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly