JDBCSupport - An easy to use, light-weight JDBC framework -
SCJP 1.5(97%) My Blog
shivendra tripathi wrote:We can avoid this by making refrence variable refering non serilizable object as transient.
If you have instance fields which are marked transient (static fields are not serialised anyway), you need to replace it when you de-serialise, otherwise it will be null and you will suffer a NullPointerExceptio
We wanted to avoid as much as possible the problem of being able to serialize an object in one virtual machine and not being able to deserialize that object in some other virtual machine. Since the security manager is part of the runtime environment, using the security manager for serialization would have violated this requirement.
Careful about the spelling: some people use automatic tools for translating which might have difficulty with "thankx."Harshana Dias wrote:Hey guys,
Thankx for the reply's..i have few doughts
Yes, the default value for primitives is 0, for reference types null, which probably also counts as 0. But you want to avoid null references.
2. I think when deserialization happen variables get the default value right?
eg: int transient x=8 will be 0 when we deserialization right?
what Campbell said only true for object reference variables right?
The serialisation is done by the JVM. I searched and found this (but you might find a more up-to-date version yourself) and this. They might (or might not ) be useful to you.4. Also why Serializable interface blank? with out functionality i mean methods define how come we accomplish the serialization process?
some people use automatic tools for translating which might have difficulty with "thankx."
The serialisation is done by the JVM.
Nitish Bangera wrote:This is the entry level SCJP concept. Well SCEA deals with JAVA EE.
Not sure. If Dog extends Animal, and Animal is Serializable, then Dog will be Serializable too. You can try writing a serialisation method and crashing it to prevent serialisation. I can't remember the details, but it is something like a readResolve method with throw new UnsupportedOperationException(); inside. But of course that means that a Dog object behaves as if it IS-NOT-AN Animal object . . .Harshana Dias wrote:by the way is Question 1 what im saying correct?
Look at the two links I quoted earlier. Or C Horstmann G Cornell, Core Java 2 vol I-fundamentals (Sun Microsystems/Prentice-Hall) chapter 12. I have the 7th (2005) edition and the section you want is about pages 662-683.Nitish Bangera wrote:Actually no body is that sure what happens in the JVM. . . .
You want me to copy out 22 pages? Show Some Effort.Nitish Bangera wrote:For what......Well if there is any thing you have to tell please write it over here.
Experience and talent are independent of age
Nitish Bangera wrote:For what......Well if there is any thing you have to tell please write it over here.
Harshana Dias wrote:Hey,
Can someone please explain me what is above two really means...practical application in java? and the connection between them?
Amit Nimbhorkar wrote:
Hi can you please explain the question in detail??
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |