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

  • SEARCH
  • Home
  • 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 6017415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:07:31+00:00 2026-05-23T03:07:31+00:00

i have a question on whether the use of using primitive data type as

  • 0

i have a question on whether the use of using primitive data type as opposed to their wrapper counter parts have any due effects on their serialization?

For example, i have a class Person

public class Person implements Serializable{
private int age;
}

as opposed to

public class Person implements Serializable{
private Integer age;
}

What are their differences?

  • 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-23T03:07:31+00:00Added an answer on May 23, 2026 at 3:07 am

    I’m speaking in terms of Java’s Serialization:

    While int is a primitive type, which stores only the value of the variable (in binary), the Integer object (using ObjectOutputStream) will store some “metadata” that when deserialization occurs, it will see the Integer object.

    Yes, serialization not only stores the object, but also the states of the object, so if you store,

    private Integer value = 5;
    

    The value is “wrapped” (lack of better word) inside Integer and the whole object is stored.

    Added note: In order not to store an object/variable, mark the field with a transient, .e.g

    transient private Integer value = 5;
    

    Related Resources:

    • Discover the secrets of the Java Serialization API
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question relating programming and english language both: Whether to use third
I have the following question: If asked whether to use a shift vs a
I have a question about whether or not a specific way of applying of
I have a very simple question. I want to test whether a particular port
I have question regarding the use of function parameters. In the past I have
I have general question regarding the use of pointers vs. references in this particular
In my project I have about 10 DataContext. My question is whether I have
I have hit upon this problem about whether to use bignums in my language
Note: This is not a question whether I should use list or deque. It's
Does the AppleWWDRCA.cer have any bearing on developing certificates using OpenSSL? If so, what?

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.