Serialize the static variable

Serialize the static variable

hello,

Can we serialize the static variable?

View Answers

October 25, 2010 at 2:53 PM

hii

Yes we can serialize the static variable.

if u don't want to serialize, u need to declare the variable as transient.


November 10, 2010 at 6:00 PM

By default the fields declared as "static" or "transient" are not serialized. If there is still a requirement to serialize the static fields... you can do it by overriding readObject() and writeObject() method.


September 27, 2012 at 10:16 PM

No We con't serialize static data. if you want real answer write serialization in one class and run the class after that you can write another class for deserialization and run the class then you get the real answer.

if you don't understand please read this post









Related Tutorials/Questions & Answers:
Serialize the static variable
Serialize the static variable  hello, Can we serialize the static variable?   hiiADS_TO_REPLACE_1 Yes we can serialize the static variable. if u don't want to serialize, u need to declare the variable as transient
Static Variable
Static Variable  What is the basic use of introducing static variable type in java?Please explain clearly....   The Static means..., it means that the static variable is shared among all instances of the class
Advertisements
static variable in php
static variable in php  How can i call a global variable as a static variable
STATIC VARIABLE DECLARATION
STATIC VARIABLE DECLARATION  why cannot the static variable declare inside the method
What is the importance of static variable?
What is the importance of static variable?  hi, What is the importance of static variable? thanks
how to inherit static variable
how to inherit static variable   how to inherit static variable or methods in Java?? Please explain the entire process of inheriting the variable. Thanks in advance
Static variable in java
Static variable in java. Static is a keyword in java used to create static methods, variable inside a class and static class. Static variable is also called class variable which belongs to class not to object. Static
Can we declare a static variable inside a method?
Can we declare a static variable inside a method?   Hi, Can we declare a static variable inside a method? thanks
non static variable cannot be referenced from static context
non static variable cannot be referenced from static context  public... "non static variable cannot be referenced from static context". How to solve... public static void main(String []s){ Add a1=new Add(); a1.add(7,8
non static variable cannot be referenced from static context
non static variable cannot be referenced from static context  public class Add{ int foo=7; int bar=8; public int add(int x,int y... public static void main(String []s){ Add a1=new Add(); a1.add(7,8
PHP Static Variable and Methods
PHP Static Methods and Variables: In this tutorial we will study when we should use static methods and variables. Static keyword is used to make only one copy of the variable for the class. All objects of that class will access one copy
Example of a class variable (static variable)
Example of a class variable (static variable)   ... you can define the static class variable in a class. When a number of objects... To see the use of a static variable first of all create a class StaticVariable
Java static method example
Description: Static variable are used within the static method. Non static variable do not exits in the static method. Static variables are shared by its class instances. Static variable can be used without using the instances
static
static  What is the exact need of declaring a variable as static?   A static variable is a variable who's single copy in memory is shared by all objects,so any modifications to the static variable will modify it's value
static
static  what r the main uses of static in java   Hi Friend, The Static means that a certain object/variable is resident in memory... is applied to member variables, it means that the static variable is shared among all
ModuleNotFoundError: No module named 'Serialize'
ModuleNotFoundError: No module named 'Serialize'  Hi, My Python... 'Serialize' How to remove the ModuleNotFoundError: No module named 'Serialize' error? Thanks   Hi, In your python environment you
static
redeclare static variable in the inherited class  can we redeclare static variable in the inherited class like this: public class StaticClass1...); **//here i have redeclared the static variable as "25" is it possible,then what
Example of a instance variable
variable in a main method. If we try to call the non-static method in the main method then the compiler will prompt you that non-static variable cannot be referenced from a static context. We can call the non-static variable by the instance
STATIC
STATIC  WHAT IS STATIC BLOCK?EXPLAIN , AND WHAT IS THE DIFFERENCE BETWEEN STATIC BLOCK AND STATIC METHOD?   A STATIC block is automatically... between static block and static method: static block will execute when ever
ModuleNotFoundError: No module named 'aliceplex-serialize'
ModuleNotFoundError: No module named 'aliceplex-serialize'  Hi, My... named 'aliceplex-serialize' How to remove the ModuleNotFoundError: No module named 'aliceplex-serialize' error? Thanks   Hi
ModuleNotFoundError: No module named 'aliceplex-serialize'
ModuleNotFoundError: No module named 'aliceplex-serialize'  Hi, My... named 'aliceplex-serialize' How to remove the ModuleNotFoundError: No module named 'aliceplex-serialize' error? Thanks   Hi
ModuleNotFoundError: No module named 'flask-serialize'
ModuleNotFoundError: No module named 'flask-serialize'  Hi, My... named 'flask-serialize' How to remove the ModuleNotFoundError: No module named 'flask-serialize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'JSON-Serialize'
ModuleNotFoundError: No module named 'JSON-Serialize'  Hi, My... named 'JSON-Serialize' How to remove the ModuleNotFoundError: No module named 'JSON-Serialize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'monero-serialize'
ModuleNotFoundError: No module named 'monero-serialize'  Hi, My... named 'monero-serialize' How to remove the ModuleNotFoundError: No module named 'monero-serialize' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'mongoengine-serialize'
ModuleNotFoundError: No module named 'mongoengine-serialize'  Hi...: No module named 'mongoengine-serialize' How to remove the ModuleNotFoundError: No module named 'mongoengine-serialize' error? Thanks   Hi
ModuleNotFoundError: No module named 'serialize-gpio'
ModuleNotFoundError: No module named 'serialize-gpio'  Hi, My... named 'serialize-gpio' How to remove the ModuleNotFoundError: No module named 'serialize-gpio' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'voluptuous-serialize'
ModuleNotFoundError: No module named 'voluptuous-serialize'  Hi...: No module named 'voluptuous-serialize' How to remove the ModuleNotFoundError: No module named 'voluptuous-serialize' error? Thanks   Hi
ModuleNotFoundError: No module named 'watson-serialize'
ModuleNotFoundError: No module named 'watson-serialize'  Hi, My... named 'watson-serialize' How to remove the ModuleNotFoundError: No module named 'watson-serialize' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'aliceplex-serialize'
ModuleNotFoundError: No module named 'aliceplex-serialize'  Hi, My... named 'aliceplex-serialize' How to remove the ModuleNotFoundError: No module named 'aliceplex-serialize' error? Thanks   Hi
ModuleNotFoundError: No module named 'django_serialize'
ModuleNotFoundError: No module named 'django_serialize'  Hi, My... named 'django_serialize' How to remove the ModuleNotFoundError: No module named 'django_serialize' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'flask-serialize'
ModuleNotFoundError: No module named 'flask-serialize'  Hi, My... named 'flask-serialize' How to remove the ModuleNotFoundError: No module named 'flask-serialize' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'JSON-Serialize'
ModuleNotFoundError: No module named 'JSON-Serialize'  Hi, My... named 'JSON-Serialize' How to remove the ModuleNotFoundError: No module named 'JSON-Serialize' error? Thanks   Hi, In your python
static keyword in java
method, static variable. A static keyword points the following: static methods. static variable.  static methods:-ADS_TO_REPLACE_1 static method..._TO_REPLACE_2 static variable:- A static variable is a special function in java
PHP Variables Static
PHP Variables Static PHP static variable is used to remember the value of a local variable when we call the function in our program. While your script is running a static variable is only retained by the function , but it is NOT shared
static
Static Concept  in what are all the situation we may use static...,then use static blocks and without creation of object we need to perform some task,then go for static methods. If we want variables those values will not be changed
Static
Static  Can i know the real time example for Static method and final variables with defenition? Thank you
ModuleNotFoundError: No module named 'django_serialize_model_graph'
ModuleNotFoundError: No module named 'django_serialize_model_graph'  ...: No module named 'django_serialize_model_graph' How to remove the ModuleNotFoundError: No module named 'django_serialize_model_graph' error
ModuleNotFoundError: No module named 'jsonschema_serialize_fork'
ModuleNotFoundError: No module named 'jsonschema_serialize_fork'  Hi...: No module named 'jsonschema_serialize_fork' How to remove the ModuleNotFoundError: No module named 'jsonschema_serialize_fork' error? Thanks  
Local Variable and Instant Variable
Local Variable and Instant Variable  difference between Local Variable and Instant Variable   Difference between local variable and instance variable Instance variable is declared within a class but not within
Declare Reference variable
variable static int b; // static variable A ref; static A refs; public static void main(String[] args) { // statements... in memory when object is created. Static variable is class variable which
static functions
)It is a variable which belongs to the class and not to object(instance). 2)Static...)A single copy to be shared by all instances of the class. 4)A static variable can...static functions  Give some brief defenition for 1. Static Variables
Converting jsp variable to java variable
Converting jsp variable to java variable  Hi how to convert java script variable to java variable on same jsp page
Maven Repository/Dependency: org.webjars.npm | serialize-javascript
Maven Repository/Dependency of Group ID org.webjars.npm and Artifact ID serialize-javascript. Latest version of org.webjars.npm:serialize-javascript dependencies. # Version Release Date
Pointer a variable
Pointer a variable  hii, Pointer is a variable or not ?   hello,ADS_TO_REPLACE_1 Yes, a pointer is a variable
Java variable
Java variable   To what value is a variable of the String type automatically initialized
static keyword
instances of the class. 4)A static variable can be accessed directly by the class name...static keyword  please give some detail about Static keyword.   Static Variables Static variables are class variables that are shared
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
private static final
private static final  Why there is necessary to make a variable private static final
jQuery 'serialize' Ajax shorthand method
jQuery 'serialize' Ajax shorthand method In this tutorial , jQuery 'serialize' method is implemented to create query for set of form elements. The 'serialize' method create URL in standard URL-encoded notation
What is a transient variable?
What is a transient variable?   Hi, What is a transient variable? Thanks,   Hi, Any variable which is altered(modified) with transient keyword becomes transient variable in java. It will be beneficiary

Ads