I have 2 objects inside one object(vector). how can i
serialize one of them. I dont want to serialize the second one
Answers were Sorted based on User's Feedback
Answer / atre sachin
suppose we are storing the two object of class A in Vector v1
class A implements serialiazable{
....
}
A a1=new A() //this will be the persist
transient A a2 =new A() //this will not persist because of the transient keyword.
now if I store the both a1 and a2 object in the vector v1 then we can achieve the goal given.
:-)
| Is This Answer Correct ? | 10 Yes | 3 No |
this answer is not correct. bcz java compiler will throw an error-illegal declaration of statement.check it out.
I think we will go for Externalizable interface. But the problem is how write the code inside writeExternal() & readExternal() methods
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / priya
yes we are able to done the above question by using
transient keyword
| Is This Answer Correct ? | 0 Yes | 2 No |
Hi friends i want display Triangle shap stars(*) please can tell me any one java code logic? * *** ***** ******* Like this
In a container there are 5 components. I want to display all the component names, how will you do that?
what is difference between throw and throws in exception?
What is the basic difference between string and stringbuffer object?
What are the various access specifiers in java?
What is a type parameter in java?
What is the is a and has a relation ship in oops concept in java?
Why are there no global variables in java?
Explain the difference between runnable and callable interface in java?
What is anagram in java?
What is treeset in java collection?
What are the types of java?