Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6959865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:19:43+00:00 2026-05-27T15:19:43+00:00

Say, I have a class X which has a field value, that is, class

  • 0

Say, I have a class X which has a field value, that is,

class X implements Serializable {
    private int value;
    // ...
}

Further it has getters and setters not displayed here. This class is serialized.
At the deserialzation, end same class has value field and access specifier is public. Further, this class does not have getters and setters. So, my questions are:

  1. Does deserialization fail in case the access specifier of the field changes OR some or all of the methods go missing in the class at the deserialization end?
  2. What is the mechanism by which fields are assigned their values during deserialization?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:19:44+00:00Added an answer on May 27, 2026 at 3:19 pm

    Some good links The Java serialization algorithm revealed

    1) does deserialization fail in case the access specifier of the field
    changes OR some or all of the methods go missing in the class at the
    deserialization end ?

    Serialization happens using Using Reflection

    Java Detects the changes to a class using the

    private static final long serialVersionUID

    The default involves a hashcode. Serialization creates a single hashcode, of type long, from the following information:

    • The class name and modifiers

    • The names of any interfaces the class implements

    • Descriptions of all methods and constructors except private methods and constructors

    • Descriptions of all fields except private, static, and private transient

    The default behavior for the serialization mechanism is a classic “better safe than sorry” strategy. The serialization mechanism uses the suid, which defaults to an extremely sensitive index, to tell when a class has changed. If so, the serialization mechanism refuses to create instances of the new class using data that was serialized with the old classes.

    2) what is the mechanism by which fields are assigned their values
    during deserialization ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have a class foo which has a private instance variable bar
Let's say I have a class that has a member called data which is
I have a modelform which has one field that is a ForeignKey value to
Say I have a class Customer which has a property FirstName . Then I
Let's say I have a Size class which has height and width properties (in
Say I have a class which represents a person, a variable within that class
I have User class which has a field type , which is in turn
Say I have a class called PermissionManager which should only exist once for my
Say I have a Date, or a Phone number, or some Class which I
Let's say you have a class called Customer, which contains the following fields: UserName

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.