GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 40 of 507    Print  
If there are 2 different versions of object streams on disk and only one object definition, how will the JVM reject the wrong one? Can you fool the JVM

  
Total Answers and Comments: 2 Last Update: March 31, 2007   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: jdemaste
 

If an object X is serialized and you perform modifications then you can ensure that the serialVersionUID  matches the first one and can thereby decieve the JVM.
There are limits altering logic is acceptable but removing fields is not.

Calculate the default serialVersionUID of an object with http://jsourcery.com/output/sourceforge/javaassist/3.0/javassist/SerialVersionUID.html



Above answer was rated as good by the following members:
geeksterrahul, talktoatish
August 11, 2005 02:52:29   
sudheer        

RE: If there are 2 different versions of object streams on disk and only one object definition, how wil...
No
we cannot fool the JVM
It willr eject the wrong one by checking class id and definitions

 
Is this answer useful? Yes | No
March 31, 2007 09:25:29   
jdemaste Member Since: March 2007   Contribution: 1    

RE: If there are 2 different versions of object strea...

If an object X is serialized and you perform modifications then you can ensure that the serialVersionUID matches the first one and can thereby decieve the JVM.
There are limits altering logic is acceptable but removing fields is not.

Calculate the default serialVersionUID of an object with http://jsourcery.com/output/sourceforge/javaassist/3.0/javassist/SerialVersionUID.html


 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    

 Related Questions

If there are 2 different versions of object streams on disk and only one object definition, how will the JVM reject the wrong one? Can you fool the JVM

When you have an object passed to a method and when the object is reassigned to a different one, then is the original reference lost

Latest Answer : Class c=Class.forName("Student");Student s=(Student)c.newInstance();Another method:Student s1= s.clone(); ...
Read Answers (5) | Asked by : chandu

Latest Answer : we can create object in different ways1.new operator2.class.forName3.newInstance4.object.clone ...
Read Answers (4) | Asked by : chandu

When we are sending the serialized array object thro the network, what is being passed ? is the value or the reference ?
Read Answers (5) | Asked by : aadi

Latest Answer : Java is not purely Object Oriented because it uses primitives. ...
Read Answers (8) | Asked by : Beena

What is the difference between an object and an instance? And give me a real time example to differentiate these two?
Read Answers (9) | Asked by : Beena

Latest Answer : Main reason is Diamond problem (ambiguity) during which JVM get the confusion that is why Java does not support the multiple inheritance. Throw interface we use the multiple inheritance but it is the alternative method in Java for getting the multiple ...
Read Answers (9) | Asked by : vas

br />1.what is oracle.2.what is major differenece oracle8i and oracle9i.4.tell me some thing ur self.5.please tell me about oops.6.what is single inheritance.7.what is multiple inheritance.8.can java support 
Latest Answer : 8.can java support multiple inheritance.java support multiple inheritance for interfaces not fro classes25.what is difference between procedure and functions.function returns only one value where as procedure returns more than one value ...
Read Answers (11) | Asked by : rajjava

Latest Answer : Because of multithreading its not pure OOP. ...
Read Answers (3) | Asked by : Beena


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

What is Comprehensive Data Definition

A Comprehensive Data Definition refers to a formal data definition that provides a complete, meaningful, easily read, readily understood definition explaining the content and meaning of data. In a business enterprise environment where people are heavily depending on intelligent business systems (bus
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape