Answer Posted / javamasque
We have to fallow below steps to serialize an object
1. The object to be serialized need to implement java.io.Serializable / java.io. Externalizable interface.
2. Generate serial version id for that serializable object.
3. ObjectOutputStream is used to write [writeObject(..) or wirteExternal()] object.
4. FileOutputStream is used to persist in flat file.
5. The flat file extension should be (<file-name>.ser)
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Explain about java sdk?
what is inner class in java?
What is a treemap in java?
Explain the features of interfaces in java?
What is the difference between stored procedure & function?
What methodology can be utilized to link to a database?
What data type is string java?
What is the difference between jvm and jre? What is an interface?
How is java hashmap implemented?
What is the default value of the local variables?
What is the purpose of default constructor?
Is there any way to find whether software installed in the
system is registered by just providing the .exe file?
I have tried the following code but its just displaying the
directory structure in the registry.
Here the code :
package com.msi.intaller;
import java.util.Iterator;
import ca.beq.util.win32.registry.RegistryKey;
import ca.beq.util.win32.registry.RootKey;
public class RegistryFinder {
public static void main(String... args) throws Exception
{
RegistryKey.initialize(RegistryFinder.class.getResource("jRe
gistryKey.dll").getFile());
RegistryKey key = new RegistryKey(RootKey.HKLM,
"Software\\ODBC");
for (Iterator
Which sorting is best in java?
What happens if constructor is private?
What is widening and narrowing in java? Discuss with an example.