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 9009171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:07:22+00:00 2026-06-16T02:07:22+00:00

Class members (static) cannot be serialized. The reason is obvious – they are not

  • 0

Class members (static) cannot be serialized. The reason is obvious – they are not held by the object(s) of the class. Since they are associated with the class (rather than the object of that class), they are stored separately from the object.

serialVersionUID is declared as a static field within a class that implements the java.io.Serializable interface something like the following.

private static final long serialVersionUID = 1L;

It is used as a version control in a Serializable class. If it is not explicitly declared, will be done automatically by JVM, based on various aspects of the Serializable class, as described by the Java(TM) Object Serialization Specification.

If it is not explicitly declared within the class implementing the Serializable interface then a warning may issue.

The serializable class SomeClass does not declare a static final
serialVersionUID field of type long

Is it serialized even though it is static, how or is it an exception to serialization?

  • 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-06-16T02:07:23+00:00Added an answer on June 16, 2026 at 2:07 am

    Serialization is done “magically,” with lots of reflection, and has all sorts of special behavior — including e.g. looking up the static serialVersionUID of the class.

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

Sidebar

Related Questions

Possible Duplicate: Do static members of a class occupy memory if no object of
1) Static class members can be used to separate data and behavior that is
For me, I usually make a global class with all members static. All other
I have a class with static members. I want to get a list of
I have a DLL which contains a class with static members . I use
I have a static class with no static constructor, but many static members. I
I intended to create a class which only have static members and static functions.
When we have a static method in a class it access only static members
What is the reasoning to why static const members cannot exist in local classes?
Is it possible to define a static class that contains overloadable members in F#?

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.